This page was last modified 18:17, 1 July 2008.
Different ways of reading a file
From Forum Nokia Wiki
Be it any platform or any mobile programming language, the file manipulation is a very important aspect of it. So this article is dedicated to different types of reading from an file in PyS60.
f = open("c://file_read.txt","rb")
this directs a file to open in a read mode you can also open in write and append mode.
f.tell()
tell function tells you about your current position
f.seek(56,0)
seek function displaces your position and reads from a position as specified. The first parameter in the function is the position and the second is the relative displacement it can take three values 0 means move to the absolute position counting from the start of the line. 1 means move to the absolute position counting from the current position. and finally 2 means move the absolute position starting from the end of file. in our case the file will read from position 56 starting from start of the line.
f.readline()
readline function will read the entire line we can also pass the parameters in the readline function.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Error:'aArrayFlat' : references must be initialized | Kapil Kaushik | General Symbian C++ | 3 | 2006-04-03 11:46 |
| Problem with sending data using bluetooth | swapnil_mahajan | Symbian Networking & Messaging | 3 | 2008-08-11 16:05 |
| Reading from an InputStream of a SocketConnection hangs on Nokia N70 phones | onestepahead | Mobile Java Tools & SDKs | 11 | 2008-05-23 13:33 |
| other ways to do CTelephony::EstablishDataCall ? (Thank you for your attention) | ronaldwh | Symbian Tools & SDKs | 4 | 2007-03-26 02:59 |
| writing data to a txt file | puh_sk8@hotmail.com | General Symbian C++ | 15 | 2006-11-07 12:06 |
