Link | file->getattr |
Author | Ke Carlton |
Category | Action |
Version | 9.x |
License | Public Domain |
Posted | 09 Jul 2013 |
Updated | 09 Jul 2013 |
More by this author... |
local(f) = file('///tmp/myfile.txt') #f->getattr('user.checksum')
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
/* --------------------------------------------------------------- // // Extended file attributes // // Reference: http://en.wikipedia.org/wiki/Extended_file_attributes */ define file->getattr(name::string,silent::boolean=true) => { // Linux / OSX only, adjust getfattr path accordingly // Example usage: file->getattr('user.checksum') local(t = micros) local( p = sys_process('/usr/bin/getfattr',staticarray('--only-values','-n',#name,file_forceroot(.path)->replace('//','/')&))->wait &, e = #p->readerror, s = #p->readstring ) handle => {#p->close} not #silent && #e && #e !>> `leading '/'` ? fail(-1,#e->asstring) return #s || #e }
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft