Daniel Berger
11/14/2006 5:09:00 AM
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