File Positioning

= filename "./by.txt" 
objFile = Open (filename, "R & lt +") from the end of the definition # required, to use "rb" mode
# 5 read .read
STR objFile.read = (. 5)
Print ( " current string is read: ", STR)
# indicates the current cursor position .tell
Posi = objFile.tell ()
Print (" the current cursor position is: ", Posi)
# re-position the cursor to a location .seek (0,0)
position objFile.seek = (2,0)
Print ( "re-position the cursor definition:", position)
STR = objFile.read (20 is)
Print ( "current string:", str)

Guess you like

Origin www.cnblogs.com/byh7595/p/11966305.html
Recommended