<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>We have a use case for walking the file system where just path information is not sufficient, we use an application agedu ( <a href="http://www.chiark.greenend.org.uk/~sgtatham/agedu/">http://www.chiark.greenend.org.uk/~sgtatham/agedu/</a> ) which apart from walking the file can take a text file as its data source and with this we can see where old data is and when it was last accessed in an easy to understand graphical form. An additional use case would be a file system where we quota disc space via groups, and finding directories with out the setguid bit set so that permission can be enforced would be useful ( although implementing -perm would be preferable and could be investigated independantly).<br><br>I have been thinking about how hard it would be to extend lfs find to provide additional information. I thought I would have a look at the code a while ago and I have thrown something together.</div><div><br></div><div>I would like to know if <br><br>a) This is a reasonable approach.<br>b) if the stat structure in param passed into cb_find_init is known always to be valid, is there a better way of getting the size back from the MDS than doing a stat ?<br><br>It would be used thus:<br><br>./lfs find /lustre/scratch101/blastdb/Supported/ --ls | head<br>147456 1328639981 1327687808 1327687808 356 0 40755 /lustre/scratch101/blastdb/Supported/<br>222153834 1327502260 1324495116 1324495116 356 102 100644 /lustre/scratch101/blastdb/Supported/embl_est_inv-3.nhr<br>248 1328573050 1326893658 1326893658 356 102 100644 /lustre/scratch101/blastdb/Supported/nr.pal<br>1000000120 1323250179 1324499009 1324499009 356 102 100644 /lustre/scratch101/blastdb/Supported/embl_gss_mus-2<br>11936568 1323250179 1324499103 1324499103 356 102 100644 /lustre/scratch101/blastdb/Supported/embl_gss_pln-1.xnt<br>4096 1328692476 1328544166 1328544394 356 102 40755 /lustre/scratch101/blastdb/Supported/uniprot_index<br><br><br>ls -la /lustre/scratch101/blastdb/Supported/embl_est_inv-3.nhr<br>-rw-r--r-- 1 pubseq crontab 222153834 2011-12-21 19:18 /lustre/scratch101/blastdb/Supported/embl_est_inv-3.nhr<br><br>I believe this patch set is based off lustre-1.8.7wc1<br><br><blockquote type="cite"><div>2043,2058c2043,2047</div><div><                 if (param->ls)  {</div><div><                         if (param->have_fileinfo == 0) {</div><div><                         /*if (st->st_size == 0 ) {*/</div><div><                                  /* Here I would like to pull </div><div><                                   * back the size guess back from</div><div><                                   * the MDS but I need a hint :) */</div><div><                                  stat(path,st);</div><div><                             }</div><div><                         llapi_printf(LLAPI_MSG_NORMAL, "%d %d %d %d %d %d %03o %s",st->st_size,st->st_atime,st->st_mtime,st->st_ctime,st->st_uid,st->st_gid,st->st_mode, path);</div><div><                  }</div><div><                   else</div><div><                     llapi_printf(LLAPI_MSG_NORMAL, "%s", path);</div><div><                  if (param->zeroend)</div><div><                     llapi_printf(LLAPI_MSG_NORMAL, "%c", '\0');</div><div><                  else</div><div><                     llapi_printf(LLAPI_MSG_NORMAL, "\n");</div><div>---</div><div>>                 llapi_printf(LLAPI_MSG_NORMAL, "%s", path);</div><div>>                 if (param->zeroend)</div><div>>                         llapi_printf(LLAPI_MSG_NORMAL, "%c", '\0');</div><div>>                 else</div><div>>                         llapi_printf(LLAPI_MSG_NORMAL, "\n");</div></blockquote><div><div><br></div></div><br><br>diff ./lustre/utils/lfs.c ../../lustre_source1/lustre-1.8.7wc1/lustre/utils/lfs.c <br>133c133<br><          "     [--maxdepth|-D N] [[!] --name|-n <pattern>] [--print0|-P] [--ls]\n"<br>---<br><blockquote type="cite">        "     [--maxdepth|-D N] [[!] --name|-n <pattern>] [--print0|-P]\n"<br></blockquote>452d451<br>< #define FIND_LS 4<br>477d475<br><                 {"ls",        no_argument,       0, FIND_LS},<br>595,598d592<br><                 case FIND_LS:<br><                         new_fashion = 1;<br><                         param.ls = 1;<br><                         break;<br><br><br>diff ./lustre/include/lustre/liblustreapi.h ../../lustre_source1/lustre-1.8.7wc1/lustre/include/lustre/liblustreapi.h<br>121d120<br><                         ls:1,</div>
<br>

-- 
 The Wellcome Trust Sanger Institute is operated by Genome Research 
 Limited, a charity registered in England with number 1021457 and a 
 company registered in England with number 2742969, whose registered 
 office is 215 Euston Road, London, NW1 2BE. 

<br></body></html>