You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# isroot is set to 1 since the size should be used for --total
143
157
return [
144
158
'-y', '0',
145
159
'-z', '0',
146
160
'-E', 'SELECT level(), 1, {0}, rpath(sname, sroll) || \'/\' || name FROM {1} WHERE name == \'{2}\';'.format(E_col,
147
-
gufi_common.VRPENTRIES,
148
-
name),
161
+
gufi_common.VRPENTRIES,
162
+
name),
149
163
]
150
164
151
165
# no flags
152
166
# print self and all subdirectories
153
-
defnone(T_col):
167
+
defnone(args):
168
+
ifargs.inodes:
169
+
T_col='{0}.totfiles + {0}.totlinks'
170
+
elifargs.apparent_size:
171
+
T_col='{0}.totsize'
172
+
else:
173
+
T_col='{0}.totblocks'
174
+
154
175
return [
155
176
'-a', '2', # run -T on all directories
156
-
'-T', 'SELECT level(), isroot, {0}, rpath(sname, sroll) FROM {1} LEFT JOIN {2} ON {1}.inode == {2}.inode;'.format(T_col,
177
+
'-T', 'SELECT level(), isroot, {0}, rpath(sname, sroll) FROM {1} LEFT JOIN {2} ON {1}.inode == {2}.inode;'.format(T_col.format(gufi_common.TREESUMMARY),
157
178
gufi_common.TREESUMMARY,
158
179
gufi_common.VRSUMMARY),
159
180
]
160
181
182
+
# --separate-dirs
183
+
defseparate_dirs(args):
184
+
ifargs.inodes:
185
+
S_col='totfiles + totlinks'
186
+
elifargs.apparent_size:
187
+
S_col='totsize'
188
+
else:
189
+
S_col='totblocks'
190
+
191
+
# summarize is turned on -> get only input path
192
+
ifargs.summarize:
193
+
return [
194
+
'-y', '0',
195
+
'-z', '0',
196
+
'-S', 'SELECT level(), isroot, {0}, rpath(sname, sroll) FROM {1} WHERE isroot == 1;'.format(S_col,
197
+
gufi_common.VRSUMMARY),
198
+
]
199
+
200
+
# get entire subtree
201
+
return [
202
+
'-S', 'SELECT level(), isroot, {0}, rpath(sname, sroll) FROM {1};'.format(S_col,
203
+
gufi_common.VRSUMMARY),
204
+
]
205
+
161
206
# --summarize
162
207
# print single size for each input path
163
-
defsummarize(T_col):
208
+
defsummarize(args):
209
+
ifargs.inodes:
210
+
T_col='{0}.totfiles + {0}.totlinks'
211
+
elifargs.apparent_size:
212
+
T_col='{0}.totsize'
213
+
else:
214
+
T_col='{0}.totblocks'
215
+
164
216
return [
165
217
'-y', '0',
166
218
'-z', '0',
167
-
'-T', 'SELECT level(), isroot, {0}, rpath(sname, sroll) FROM {1} LEFT JOIN {2} ON {1}.inode == {2}.inode WHERE {2}.isroot == 1;'.format(T_col,
168
-
gufi_common.TREESUMMARY,
169
-
gufi_common.VRSUMMARY),
219
+
'-T', 'SELECT level(), isroot, {0}, rpath(sname, sroll) FROM {1} LEFT JOIN {2} ON {1}.inode == {2}.inode WHERE {2}.isroot == 1;'.format(T_col.format(gufi_common.TREESUMMARY),
0 commit comments