Mercurial > hgrepos > Python > apps > py-cutils
comparison cutils/util/walk.py @ 352:b256ae4f4bc8
treesum: implement the "filetypes" command to show all the filetype indicators that are used in digest output
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Tue, 01 Apr 2025 20:38:06 +0200 |
| parents | 0a58948df713 |
| children | 7761a15b9736 |
comparison
equal
deleted
inserted
replaced
| 351:3e29b3e648d3 | 352:b256ae4f4bc8 |
|---|---|
| 24 scandir = None | 24 scandir = None |
| 25 import stat | 25 import stat |
| 26 import sys | 26 import sys |
| 27 | 27 |
| 28 from . import PY2 | 28 from . import PY2 |
| 29 | |
| 30 | |
| 31 HELP_FILETYPE_INDICATORS = r""" | |
| 32 FILETYPE INDICATORS | |
| 33 =================== | |
| 34 | |
| 35 File and directory paths are printed using names analogous to calling | |
| 36 "ls -F/--classify". The indicator strings (aka "marker" or "tags") are | |
| 37 appended to their names as follows. | |
| 38 | |
| 39 Some standard indicators are: | |
| 40 | |
| 41 / | |
| 42 denotes a directory | |
| 43 | |
| 44 /./@/ | |
| 45 denotes a symbolic link to a directory | |
| 46 | |
| 47 /./@ | |
| 48 Classifies a symlink to a regular filesystem object (i.e. a regular file). | |
| 49 The target objects are not classified as directories or other special | |
| 50 filesystem objects. | |
| 51 Also used if a symbolic link is broken and the target type cannot | |
| 52 determined. | |
| 53 | |
| 54 /./| --- /./@| | |
| 55 FIFO --- symlink to FIFO | |
| 56 | |
| 57 /./= --- /./@= | |
| 58 Socket --- symlink to socket | |
| 59 | |
| 60 /./> --- /./@> | |
| 61 Door -- symlink to door. | |
| 62 | |
| 63 Solaris. | |
| 64 | |
| 65 /./% --- /./@% | |
| 66 Whiteout --- symlink to whiteout. | |
| 67 | |
| 68 Typically Used by union filesystems) (BSD). | |
| 69 | |
| 70 More non-standard indicators are: | |
| 71 | |
| 72 /./: --- /./@: | |
| 73 Character special device --- symlink to character special device | |
| 74 | |
| 75 /./; --- /./@; | |
| 76 Block special device --- symlink to block special device | |
| 77 | |
| 78 /./+ --- /./@+ | |
| 79 Event port --- symlink to event port. | |
| 80 | |
| 81 Solaris, Illumos. | |
| 82 | |
| 83 In an aggregated (directory) checksum at the end of a block the following | |
| 84 indicators are used: | |
| 85 | |
| 86 ./@/ | |
| 87 Symbolic link to a directory | |
| 88 | |
| 89 ./@ | |
| 90 Symbolic link to other filesystem object. | |
| 91 | |
| 92 Also used if the link is broken and the target type cannot determined. | |
| 93 | |
| 94 NOTE: Executable files have no special indicator here. The "ls -F" command | |
| 95 would use the `*' character in this case. | |
| 96 | |
| 97 """ | |
| 29 | 98 |
| 30 | 99 |
| 31 _notset = object() | 100 _notset = object() |
| 32 | 101 |
| 33 _logger = logging.getLogger(__name__) | 102 _logger = logging.getLogger(__name__) |
