Added a generic query interface: https://github.com/xrootd/xrootd/commit/33e37b07d9947b366e4ca26b5a06986e1efbbfdc You can query for a given flag: ``` ]=[pon 14/01/27 10:25 CET]=[ljanyst@idefix:~/Projects/xroot/code/master/build] ]==> xrdfs castorpublic stat /castor/cern.ch/user/l/ljanyst/user.RichardHawkings.0108173.topmix_Egamma.AOD.v2._00039.pool.root -q "IsDir" Path: /castor/cern.ch/user/l/ljanyst/user.RichardHawkings.0108173.topmix_Egamma.AOD.v2._00039.pool.root Id: 2418223087666331648 Size: 791773689 Flags: 117 (XBitSet|Other|POSCPending|IsReadable|IsWritable) Query: IsDir [ERROR] Query response negative ]=[pon 14/01/27 10:25 CET]=[ljanyst@idefix:~/Projects/xroot/code/master/build] ]==> echo $? 55 ``` ``` ]=[pon 14/01/27 10:26 CET]=[ljanyst@idefix:~/Projects/xroot/code/master/build] ]==> xrdfs castorpublic stat /castor/cern.ch/user/l/ljanyst/user.RichardHawkings.0108173.topmix_Egamma.AOD.v2._00039.pool.root -q "IsReadable" Path: /castor/cern.ch/user/l/ljanyst/user.RichardHawkings.0108173.topmix_Egamma.AOD.v2._00039.pool.root Id: 2418223087666331648 Size: 791773689 Flags: 117 (XBitSet|Other|POSCPending|IsReadable|IsWritable) Query: IsReadable ]=[pon 14/01/27 10:26 CET]=[ljanyst@idefix:~/Projects/xroot/code/master/build] ]==> echo $? 0 ``` Query of an or'd combination of flags: ``` ]=[pon 14/01/27 10:25 CET]=[ljanyst@idefix:~/Projects/xroot/code/master/build] ]==> xrdfs castorpublic stat /castor/cern.ch/user/l/ljanyst/user.RichardHawkings.0108173.topmix_Egamma.AOD.v2._00039.pool.root -q "IsDir|Other|IsReadable" Path: /castor/cern.ch/user/l/ljanyst/user.RichardHawkings.0108173.topmix_Egamma.AOD.v2._00039.pool.root Id: 2418223087666331648 Size: 791773689 Flags: 117 (XBitSet|Other|POSCPending|IsReadable|IsWritable) Query: IsDir|Other|IsReadable ]=[pon 14/01/27 10:25 CET]=[ljanyst@idefix:~/Projects/xroot/code/master/build] ]==> echo $? 0 ``` Query for an and'd combination of flags: ``` ]=[pon 14/01/27 10:25 CET]=[ljanyst@idefix:~/Projects/xroot/code/master/build] ]==> xrdfs castorpublic stat /castor/cern.ch/user/l/ljanyst/user.RichardHawkings.0108173.topmix_Egamma.AOD.v2._00039.pool.root -q "IsDir&Other" Path: /castor/cern.ch/user/l/ljanyst/user.RichardHawkings.0108173.topmix_Egamma.AOD.v2._00039.pool.root Id: 2418223087666331648 Size: 791773689 Flags: 117 (XBitSet|Other|POSCPending|IsReadable|IsWritable) Query: IsDir&Other [ERROR] Query response negative ]=[pon 14/01/27 10:26 CET]=[ljanyst@idefix:~/Projects/xroot/code/master/build] ]==> echo $? 55 ``` ``` ]=[pon 14/01/27 10:26 CET]=[ljanyst@idefix:~/Projects/xroot/code/master/build] ]==> xrdfs castorpublic stat /castor/cern.ch/user/l/ljanyst/user.RichardHawkings.0108173.topmix_Egamma.AOD.v2._00039.pool.root -q "XBitSet&Other" Path: /castor/cern.ch/user/l/ljanyst/user.RichardHawkings.0108173.topmix_Egamma.AOD.v2._00039.pool.root Id: 2418223087666331648 Size: 791773689 Flags: 117 (XBitSet|Other|POSCPending|IsReadable|IsWritable) Query: XBitSet&Other ]=[pon 14/01/27 10:26 CET]=[ljanyst@idefix:~/Projects/xroot/code/master/build] ]==> echo $? 0 ``` Note: you get a different shell code when it fails for other reasons: ``` ]=[pon 14/01/27 10:26 CET]=[ljanyst@idefix:~/Projects/xroot/code/master/build] ]==> xrdfs castorpublic stat /castor/cern.ch/user/l/ljanyst/user.RichardHawkings -q "IsReadable" [ERROR] Server responded with an error: [3011] Unable to stat /castor/cern.ch/user/l/ljanyst/user.RichardHawkings; No such file or directory ]=[pon 14/01/27 10:27 CET]=[ljanyst@idefix:~/Projects/xroot/code/master/build] ]==> echo $? 54 ``` --- Reply to this email directly or view it on GitHub: https://github.com/xrootd/xrootd/issues/69#issuecomment-33352776 ######################################################################## Use REPLY-ALL to reply to list To unsubscribe from the XROOTD-DEV list, click the following link: https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1