Changeset 03134ee in trunk
- Timestamp:
- 2010-02-20T06:13:13Z (15 years ago)
- Branches:
- master
- Children:
- 9741b96
- Parents:
- b7c0248
- Location:
- src/allmydata/scripts
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/allmydata/scripts/cli.py ¶
rb7c0248 r03134ee 86 86 self.where = where 87 87 88 longdesc = """List the contents of some portion of the grid.""" 88 longdesc = """ 89 List the contents of some portion of the grid. 90 91 When the -l or --long option is used, each line is shown in the 92 following format: 93 94 drwx <size> <date/time> <name in this directory> 95 96 where each of the letters on the left may be replaced by '-'. 97 If 'd' is present, it indicates that the object is a directory. 98 If the 'd' is replaced by a '?', the object type is unknown. 99 'rwx' is a Unix-like permissions mask: if the mask includes 'w', 100 then the object is writable through its link in this directory. 101 The 'x' is a legacy of Unix filesystems. In Tahoe it is used 102 only to indicate that the contents of a directory can be listed. 103 104 Directories have no size, so their size field is shown as '-'. 105 Otherwise the size of the file, when known, is given in bytes. 106 The size of mutable files or unknown objects is shown as '?'. 107 108 The date/time shows when this link in the Tahoe filesystem was 109 last modified. 110 """ 89 111 90 112 class GetOptions(VDriveOptions): -
TabularUnified src/allmydata/scripts/common.py ¶
rb7c0248 r03134ee 140 140 path = path.strip() 141 141 if uri.has_uri_prefix(path): 142 # The only way to get a sub-path is to use URI:blah:./foo, and we 143 # strip out the :./ sequence. 142 # We used to require "URI:blah:./foo" in order to get a subpath, 143 # stripping out the ":./" sequence. We still allow that for compatibility, 144 # but now also allow just "URI:blah/foo". 144 145 sep = path.find(":./") 145 146 if sep != -1: 146 147 return path[:sep], path[sep+3:] 148 sep = path.find("/") 149 if sep != -1: 150 return path[:sep], path[sep+1:] 147 151 return path, "" 148 152 colon = path.find(":") -
TabularUnified src/allmydata/scripts/tahoe_ls.py ¶
rb7c0248 r03134ee 56 56 if nodetype == "dirnode": 57 57 children = d['children'] 58 el if nodetype == "filenode":58 else: 59 59 childname = path.split("/")[-1] 60 60 children = {childname: (nodetype, d)} … … 68 68 # variable-width ones. 69 69 rows = [] 70 has_unknowns = False 70 71 71 72 for name in childnames: … … 102 103 elif childtype == "filenode": 103 104 t0 = "-" 104 size = str(child[1] ['size'])105 size = str(child[1].get("size", "?")) 105 106 classify = "" 106 107 if rw_uri: 107 108 classify = "*" 108 109 else: 110 has_unknowns = True 109 111 t0 = "?" 110 112 size = "?" … … 162 164 print >>stdout, (fmt % tuple(row)).rstrip() 163 165 166 if has_unknowns: 167 print >>stderr, "\nThis listing included unknown objects. Using a webapi server that supports" \ 168 "\na later version of Tahoe may help." 169 164 170 return 0 165 171
Note: See TracChangeset
for help on using the changeset viewer.