Casimir
11/21/2007 9:34:00 AM
> Casimir P wrote:
>> saveresized = savetargetstr.to_s + "/" + path.split("/").last + "/" +
>> (m+1).to_s + "fullsize" + imageFormat
>> #and then write and FAIL..
>> #Double slash kills..
>> #Or directory doesnt exist!
Jari Williamsson wrote:
>
> 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)
Csmr