Computer Science, asked by queensp73, 9 months ago

Which of the following statements correctly explain the function of seek() method?

A. tell the current position within the file.
B. indicate that the next read or write occurs from that position in a file.
C. determine if you can move the file position or not.
D. move the current file position to a different location at a defined offset.

Answers

Answered by aburaihana123
0

Option D. move the current file position to a different location at a defined offset  

Explanation:

  • The seek() method is used to shift the File Handle's position to a certain location. A filehandle functions similarly to a cursor, indicating where data should be read or written in the file. The seek() method moves the file to the offset point.

The seek() method has the following syntax: fileObject. seek (offset[, whence])

  • offset - This is the location of the read/write pointer within the file.
  • whence - This is an optional parameter that defaults to 0 for absolute file placement, 1 for seek relative to the current position, and 2 for seek relative to the file's end.

Similar questions