]> granicus.if.org Git - python/commitdiff
Added SEEK_* constants. Fixes #711830.
authorMartin v. Löwis <martin@v.loewis.de>
Sun, 16 Jan 2005 08:40:58 +0000 (08:40 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Sun, 16 Jan 2005 08:40:58 +0000 (08:40 +0000)
Doc/lib/libos.tex
Lib/os.py
Misc/NEWS

index b1c06b1fa2ba5430661514ffe6243f8245bdeea1..995e432470e11eed395bf41680ca3897819ad2e1 100644 (file)
@@ -636,6 +636,15 @@ These can be bit-wise OR'd together.
 Availability: Windows.
 \end{datadesc}
 
+\begin{datadesc}{SEEK_SET}
+\dataline{SEEK_CUR}
+\dataline{SEEK_END}
+Parameteters to the \function{lseek()} function.
+Their values are 0, 1, and 2, respectively.
+Availability: Windows, Macintosh, \UNIX.
+\versionadded{2.5}
+\end{datadesc}
+
 \subsection{Files and Directories \label{os-file-dir}}
 
 \begin{funcdesc}{access}{path, mode}
index 65b1830f8b9afc1eaab8b5903decc687fbcdf8fc..d3b9a8d5107cf01af4fd4e821c102da1b7ee6e3f 100644 (file)
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -29,7 +29,8 @@ _names = sys.builtin_module_names
 
 # Note:  more names are added to __all__ later.
 __all__ = ["altsep", "curdir", "pardir", "sep", "pathsep", "linesep",
-           "defpath", "name", "path", "devnull"]
+           "defpath", "name", "path", "devnull",
+           "SEEK_SET", "SEEK_CUR", "SEEK_END"]
 
 def _get_exports_list(module):
     try:
@@ -135,6 +136,12 @@ from os.path import (curdir, pardir, sep, pathsep, defpath, extsep, altsep,
 
 del _names
 
+# Python uses fixed values for the SEEK_ constants; they are mapped
+# to native constants if necessary in posixmodule.c
+SEEK_SET = 0
+SEEK_CUR = 1
+SEEK_END = 2
+
 #'
 
 # Super directory utilities.
index 6385157b9c956a04b6a53ec82e855cab8b0952e9..049239219cdb35d9888c150c1b4b11a2a04f855d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -37,6 +37,8 @@ Extension Modules
 Library
 -------
 
+- os.{SEEK_SET, SEEK_CUR, SEEK_END} have been added for convenience.
+
 - Enhancements to the csv module:
 
   + Dialects are now validated by the underlying C code, better