Does anyone know what's broken about ftools?

W

Wes Gamble

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
 
W

Wilson Bilkovich

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.
 
D

Daniel Berger

Wilson said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top