Article From:https://www.cnblogs.com/xiamenghan/p/9688594.html

Big premise: The movement of pointers in a file is in Bytes, but the number of reads in T mode is in characters.

 

f.seek(The number of bytes of pointer movement, mode control): control the movement of file pointer.

Mode control:

0:The default mode, which represents the number of bytes moved by the pointer, is based on the beginning of the file.

1:This mode represents the number of bytes moved by pointer, referring to the current location.

2:This mode represents the number of bytes moved by pointer, referring to the position at the end of the file.

Stress: 0 of them can be used in t or B mode, while 1 and 2 mode can only be used in B mode.

f.tell()View the current position of the file pointer from the beginning of the file.

 

Link of this Article: Pointer movement in file

Leave a Reply

Your email address will not be published. Required fields are marked *