Is there anything you comp.lang.ruby readers would recommend that would abstract away things like "if file load fails" or "if file not found" or "index of all .xml -files in the subdirs"?
I can do the rescue patrol -mission, but time is running out! Lost on the Apache mountain. I am not sure my squad will get us there on time...
Not looking for anything big, preferably small and simple (ie. practical).
Datum: Tue, 20 Nov 2007 20:15:04 +0900
Von: Casimir <pikEISPAMMMseli@welho.com>
An: ruby-talk@ruby-lang.org
Betreff: Libs for high-level file processing?
Is there anything you comp.lang.ruby readers would recommend that would
abstract away things like "if file load fails" or "if file not found" or
"index of all .xml -files in the subdirs"?
I can do the rescue patrol -mission, but time is running out! Lost on
the Apache mountain. I am not sure my squad will get us there on time...
Not looking for anything big, preferably small and simple (ie. practical).
Is there anything you comp.lang.ruby readers would recommend that would
abstract away things like "if file load fails" or "if file not found" or
"index of all .xml -files in the subdirs"?
--
use.inject do |as, often| as.you_can - without end
Datum: Tue, 20 Nov 2007 20:15:04 +0900 Von: Casimir
<pikEISPAMMMseli@welho.com> An: ruby-talk@ruby-lang.org
Betreff: Libs for high-level file processing?
Is there anything you comp.lang.ruby readers would recommend that would
abstract away things like "if file load fails" or "if file not found"
or "index of all .xml -files in the subdirs"?
if File.exists? $imgSourcePathStr
if File.exists? $imgDestPathStr
indexedDirs = indexImagesInDirs
($imgSourcePathStrs, $imgDestPathStr)
else
puts "no dest!"
exit
end
else
puts "no src!"
exit
end
On Tue, 20 Nov 2007 10:06:36 -0500, Axel Etzold wrote:
On Tue, 20 Nov 2007 11:49:30 -0500, Robert Klemme wrote:
--
Casimir Pohjanraito
Art Portfolio: http://csmr.dreamhosters.com
I think the lines above are more easily handled if you use the methods in the core File library, such as File.basename etc. Much to choose from there.
Yes. I was oblivious to File.basename which was exactly what I was looking for. Thank you for pushing me in the right direction!
But I was not waste of time! I twas gathering cases for file ops. IT's easy! 8)
Here's what I got, minimal case plan
- Open file
- Create file that doesn't exist, open
- Save file
- Overwrite file
- Dir doesnt exist, create
- get filename from path str (file.basename).
- get the sub dir file is ("deepest" dir)
- remove dbl slashes (etc crap).
- nonrelative dir (remove /dir1/../dir1/ etc.)
I was looking for guide covering these on google. Didn't find one. I guess I will have to write a micro guide to these. 8)