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

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
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 covert a file's mode in a human
stoneleaf 2014/06/13 15:49:58 'covert' should be 'convert' - can you fix this as
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 for more detail on the meaning of these
406 constants.
haypo 2014/06/13 16:00:20 It would be nice to document these options here :)
loewis 2014/06/13 21:41:01 We shouldn't replicate Microsoft's documentation (
407
408 .. data:: FILE_ATTRIBUTE_ARCHIVE
409 FILE_ATTRIBUTE_COMPRESSED
410 FILE_ATTRIBUTE_DEVICE
411 FILE_ATTRIBUTE_DIRECTORY
412 FILE_ATTRIBUTE_ENCRYPTED
413 FILE_ATTRIBUTE_HIDDEN
414 FILE_ATTRIBUTE_INTEGRITY_STREAM
415 FILE_ATTRIBUTE_NORMAL
416 FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
417 FILE_ATTRIBUTE_NO_SCRUB_DATA
418 FILE_ATTRIBUTE_OFFLINE
419 FILE_ATTRIBUTE_READONLY
420 FILE_ATTRIBUTE_REPARSE_POINT
421 FILE_ATTRIBUTE_SPARSE_FILE
422 FILE_ATTRIBUTE_SYSTEM
423 FILE_ATTRIBUTE_TEMPORARY
424 FILE_ATTRIBUTE_VIRTUAL
425
stoneleaf 2014/06/13 15:49:58 Instead of spelling out FILE_ATTRIBUTE_ each time,
haypo 2014/06/13 16:02:11 No, you should use the full name. It allows to me
426 .. versionadded:: 3.5
OLDNEW
« no previous file with comments | « Doc/library/os.rst ('k') | Lib/test/test_os.py » ('j') | Lib/test/test_os.py » ('J')

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