[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Does anyone know what's broken about ftools?

Wes Gamble

11/13/2006 11:11:00 PM

All,

I just had a problem in my Rails app. where I was generating a ZIP file
(using rubyzip) on Linux and copying to a Windows share (mounted via
Samba) using ftools and sometimes partial copies would occur.

I then saw via perusing some posts online that "ftools is obsolete" and
even the pickaxe book says "The FileUtils library is now recommended
over ftools."

I got my code working by using FileUtils, which is great, but can anyone
explain any known issues with ftools?

Thanks,
Wes

--
Posted via http://www.ruby-....

3 Answers

Wilson Bilkovich

11/14/2006 3:32:00 AM

0

On 11/13/06, Wes Gamble <weyus@att.net> wrote:
> All,
>
> I just had a problem in my Rails app. where I was generating a ZIP file
> (using rubyzip) on Linux and copying to a Windows share (mounted via
> Samba) using ftools and sometimes partial copies would occur.
>
> I then saw via perusing some posts online that "ftools is obsolete" and
> even the pickaxe book says "The FileUtils library is now recommended
> over ftools."
>
> I got my code working by using FileUtils, which is great, but can anyone
> explain any known issues with ftools?
>

ftools operated by adding features to the 'File' class. That's a
little messy and strange.. so 'fileutils' moved all that into its own
module. (e.g. FileUtils.mv instead of File.mv).

The old one will still work, but you should probably avoid it, in case
it goes away in 1.9.

Daniel Berger

11/14/2006 5:09:00 AM

0

Wilson Bilkovich wrote:
> On 11/13/06, Wes Gamble <weyus@att.net> wrote:
>> All,
>>
>> I just had a problem in my Rails app. where I was generating a ZIP file
>> (using rubyzip) on Linux and copying to a Windows share (mounted via
>> Samba) using ftools and sometimes partial copies would occur.
>>
>> I then saw via perusing some posts online that "ftools is obsolete" and
>> even the pickaxe book says "The FileUtils library is now recommended
>> over ftools."
>>
>> I got my code working by using FileUtils, which is great, but can anyone
>> explain any known issues with ftools?
>>
>
> ftools operated by adding features to the 'File' class. That's a
> little messy and strange.. so 'fileutils' moved all that into its own
> module. (e.g. FileUtils.mv instead of File.mv).
>
> The old one will still work, but you should probably avoid it, in case
> it goes away in 1.9.
>
>
In addition, I've experienced the exact same problem the OP describes -
partial copies to a Windows share mounted via Samba on Linux. I never
bothered to look at the implementation, but clearly the FileUtils.cp
implementation is superior to the ftools version of File.copy. So, part
of the reason that "ftools is obsolete" is because "FileUtils is better". :)

Regards,

Dan

ebeard

11/14/2006 3:50:00 PM

0

Is there another option for File.compare()?