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

Delta Between Two Patch Sets: Doc/library/stat.rst

Issue 21719: Returning Windows file attribute information via os.stat()
Left Patch Set: Created 5 years, 7 months ago
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Doc/library/os.rst ('k') | Lib/stat.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 402
403 On Windows, the following file attribute constants are available for use when 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`. 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 405 See the `Windows API documentation
406 constants. 406 <http://msdn.microsoft.com/en-us/library/windows/desktop/gg258117.aspx>`_
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 for more detail on the meaning of these constants.
407 408
408 .. data:: FILE_ATTRIBUTE_ARCHIVE 409 .. data:: FILE_ATTRIBUTE_ARCHIVE
409 FILE_ATTRIBUTE_COMPRESSED 410 FILE_ATTRIBUTE_COMPRESSED
410 FILE_ATTRIBUTE_DEVICE 411 FILE_ATTRIBUTE_DEVICE
411 FILE_ATTRIBUTE_DIRECTORY 412 FILE_ATTRIBUTE_DIRECTORY
412 FILE_ATTRIBUTE_ENCRYPTED 413 FILE_ATTRIBUTE_ENCRYPTED
413 FILE_ATTRIBUTE_HIDDEN 414 FILE_ATTRIBUTE_HIDDEN
414 FILE_ATTRIBUTE_INTEGRITY_STREAM 415 FILE_ATTRIBUTE_INTEGRITY_STREAM
415 FILE_ATTRIBUTE_NORMAL 416 FILE_ATTRIBUTE_NORMAL
416 FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 417 FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
417 FILE_ATTRIBUTE_NO_SCRUB_DATA 418 FILE_ATTRIBUTE_NO_SCRUB_DATA
418 FILE_ATTRIBUTE_OFFLINE 419 FILE_ATTRIBUTE_OFFLINE
419 FILE_ATTRIBUTE_READONLY 420 FILE_ATTRIBUTE_READONLY
420 FILE_ATTRIBUTE_REPARSE_POINT 421 FILE_ATTRIBUTE_REPARSE_POINT
421 FILE_ATTRIBUTE_SPARSE_FILE 422 FILE_ATTRIBUTE_SPARSE_FILE
422 FILE_ATTRIBUTE_SYSTEM 423 FILE_ATTRIBUTE_SYSTEM
423 FILE_ATTRIBUTE_TEMPORARY 424 FILE_ATTRIBUTE_TEMPORARY
424 FILE_ATTRIBUTE_VIRTUAL 425 FILE_ATTRIBUTE_VIRTUAL
425 426
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 427 .. versionadded:: 3.5
LEFTRIGHT

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