|
|
Create a directory list in CSV format
And here's a version that doesn't require parsing the output of 'ls -l'
I'm sure someone will followup with the ruby version shortly. :-)
j.
Ruby version
With no 'ls' at all:
ruby -e 'Dir.foreach(".") {|f| x=File.stat(f) ; puts "#{f}, #{x.ctime}, #{x.size}"'} It could probably be shorter/prettier, and the output isn't exactly like the original, but it'll do. :-D
Another Ruby, this time with ls
ls | ruby -lne 'x = File.stat($_); puts "#{$_}, #{x.ctime}, #{x.size}"'
I suppose that one's cleaner than the other, but I still like the other better 'coz it's all Ruby. I'm weird that way. :-}
Another Ruby, this time with ls
oddly enough this one fails with a folder with a custom icon. |
SearchFrom our Sponsor...Latest Mountain Lion HintsWhat's New:HintsNo new hintsComments last 2 daysNo new commentsLinks last 2 weeksNo recent new linksWhat's New in the Forums?
Hints by TopicNews from Macworld
From Our Sponsors |
|
Copyright © 2014 IDG Consumer & SMB (Privacy Policy) Contact Us All trademarks and copyrights on this page are owned by their respective owners. |
Visit other IDG sites: |
|
|
|
Created this page in 0.05 seconds |
|