@@ -1061,6 +1061,10 @@ as internal buffering of data.
10611061 current position; :const: `SEEK_END ` or ``2 `` to set it relative to the end of
10621062 the file. Return the new cursor position in bytes, starting from the beginning.
10631063
1064+ .. versionchanged :: 3.3
1065+
1066+ Add support for :const: `SEEK_HOLE ` and :const: `SEEK_DATA `.
1067+
10641068
10651069.. data :: SEEK_SET
10661070 SEEK_CUR
@@ -1069,9 +1073,30 @@ as internal buffering of data.
10691073 Parameters to the :func: `lseek ` function. Their values are 0, 1, and 2,
10701074 respectively.
10711075
1076+
1077+ .. data :: SEEK_HOLE
1078+ SEEK_DATA
1079+
1080+ Parameters to the :func: `lseek ` function and the :meth: `~io.IOBase.seek `
1081+ method on file objects, for seeking file data and holes on sparsely
1082+ allocated files.
1083+
1084+ :data: `!SEEK_DATA `
1085+ Adjust the file offset to the next location containing data,
1086+ relative to the seek position.
1087+
1088+ :data: `!SEEK_HOLE `
1089+ Adjust the file offset to the next location containing a hole,
1090+ relative to the seek position.
1091+ A hole is defined as a sequence of zeros.
1092+
1093+ .. note ::
1094+
1095+ These operations only make sense for filesystems that support them.
1096+
1097+ .. availability :: Linux >= 3.1, macOS, Unix
1098+
10721099 .. versionadded :: 3.3
1073- Some operating systems could support additional values, like
1074- :const: `os.SEEK_HOLE ` or :const: `os.SEEK_DATA `.
10751100
10761101
10771102.. function :: open(path, flags, mode=0o777, *, dir_fd=None)
0 commit comments