Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1)

Side by Side Diff: Doc/library/stat.rst

Issue 21719: Returning Windows file attribute information via os.stat()
Patch Set: Created 5 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Doc/library/os.rst ('k') | Lib/stat.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`stat` --- Interpreting :func:`~os.stat` results 1 :mod:`stat` --- Interpreting :func:`~os.stat` results
2 ===================================================== 2 =====================================================
3 3
4 .. module:: stat 4 .. module:: stat
5 :synopsis: Utilities for interpreting the results of os.stat(), 5 :synopsis: Utilities for interpreting the results of os.stat(),
6 os.lstat() and os.fstat(). 6 os.lstat() and os.fstat().
7 .. sectionauthor:: Skip Montanaro <skip@automatrix.com> 7 .. sectionauthor:: Skip Montanaro <skip@automatrix.com>
8 8
9 **Source code:** :source:`Modules/_stat.c` 9 **Source code:** :source:`Modules/_stat.c`
10 :source:`Lib/stat.py` 10 :source:`Lib/stat.py`
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 else: 119 else:
120 # Unknown file type, print a message 120 # Unknown file type, print a message
121 print('Skipping %s' % pathname) 121 print('Skipping %s' % pathname)
122 122
123 def visitfile(file): 123 def visitfile(file):
124 print('visiting', file) 124 print('visiting', file)
125 125
126 if __name__ == '__main__': 126 if __name__ == '__main__':
127 walktree(sys.argv[1], visitfile) 127 walktree(sys.argv[1], visitfile)
128 128
129 An additional utility function is provided to covert a file's mode in a human 129 An additional utility function is provided to convert a file's mode in a human
130 readable string: 130 readable string:
131 131
132 .. function:: filemode(mode) 132 .. function:: filemode(mode)
133 133
134 Convert a file's mode to a string of the form '-rwxrwxrwx'. 134 Convert a file's mode to a string of the form '-rwxrwxrwx'.
135 135
136 .. versionadded:: 3.3 136 .. versionadded:: 3.3
137 137
138 .. versionchanged:: 3.4 138 .. versionchanged:: 3.4
139 The function supports :data:`S_IFDOOR`, :data:`S_IFPORT` and 139 The function supports :data:`S_IFDOOR`, :data:`S_IFPORT` and
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 392
393 .. data:: SF_NOUNLINK 393 .. data:: SF_NOUNLINK
394 394
395 The file may not be renamed or deleted. 395 The file may not be renamed or deleted.
396 396
397 .. data:: SF_SNAPSHOT 397 .. data:: SF_SNAPSHOT
398 398
399 The file is a snapshot file. 399 The file is a snapshot file.
400 400
401 See the \*BSD or Mac OS systems man page :manpage:`chflags(2)` for more informat ion. 401 See the \*BSD or Mac OS systems man page :manpage:`chflags(2)` for more informat ion.
402
403 On Windows, the following file attribute constants are available for use when
404 testing bits in the ``st_file_attributes`` member returned by :func:`os.stat`.
405 See the `Windows API documentation
406 <http://msdn.microsoft.com/en-us/library/windows/desktop/gg258117.aspx>`_
407 for more detail on the meaning of these constants.
408
409 .. data:: FILE_ATTRIBUTE_ARCHIVE
410 FILE_ATTRIBUTE_COMPRESSED
411 FILE_ATTRIBUTE_DEVICE
412 FILE_ATTRIBUTE_DIRECTORY
413 FILE_ATTRIBUTE_ENCRYPTED
414 FILE_ATTRIBUTE_HIDDEN
415 FILE_ATTRIBUTE_INTEGRITY_STREAM
416 FILE_ATTRIBUTE_NORMAL
417 FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
418 FILE_ATTRIBUTE_NO_SCRUB_DATA
419 FILE_ATTRIBUTE_OFFLINE
420 FILE_ATTRIBUTE_READONLY
421 FILE_ATTRIBUTE_REPARSE_POINT
422 FILE_ATTRIBUTE_SPARSE_FILE
423 FILE_ATTRIBUTE_SYSTEM
424 FILE_ATTRIBUTE_TEMPORARY
425 FILE_ATTRIBUTE_VIRTUAL
426
427 .. versionadded:: 3.5
OLDNEW
« no previous file with comments | « Doc/library/os.rst ('k') | Lib/stat.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+