Understanding ftools

Hi,

I’m a little puzzled by the File class. Can someone explain why I
there’s File.delete, File.rename, and the other file operations, but if
I want to copy a file, I need to use ‘require ftools’ ? I know perl has
this, but I could never make sense of it. Please explain the advantages
if any.

Daniel

···


A.D. 1844: Samuel Morse invents Morse code. Cryptography export
restrictions prevent the telegraph’s use outside the U.S. and Canada.

It may be because delete, rename etc. are translated directly to the
operation system call or a low-level C library function. On the other hand
for copy you have a relatively complex procedure:

open source file for reading
open target file for writting
while not eof(source)
read source
write target
end

not even mentioning error checks.

Dalibor Sramek

···

On Thu, Nov 07, 2002 at 02:22:08AM +0900, Daniel Bretoi wrote:

I’m a little puzzled by the File class. Can someone explain why I
there’s File.delete, File.rename, and the other file operations, but if
I want to copy a file, I need to use ‘require ftools’ ? I know perl has
this, but I could never make sense of it. Please explain the advantages
if any.


Dalibor Sramek “In the eyes of cats, all things belong to cats.”
dali@insula.cz

I’m a little puzzled by the File class. Can someone explain why I
there’s File.delete, File.rename, and the other file operations, but if
I want to copy a file, I need to use ‘require ftools’ ? I know perl has
this, but I could never make sense of it. Please explain the advantages
if any.

It may be because delete, rename etc. are translated directly to the
operation system call or a low-level C library function. On the other hand
for copy you have a relatively complex procedure:

Hi,

A plausible solution, but other operations such as split, must
also have more overhead? I think it’s funny that the line got drawn
there with such a common operation of files. I feel that any scripting
language should be at the very basic be easily substituted for doing
commandline-batch jobs.

Is the lack of response to this question because noone really knows, or
is it because it’s an overdebated subject, or because it’s obvious?

db

···

On Thu, Nov 07, 2002 at 06:25:32PM +0900, Dalibor Sramek wrote:

On Thu, Nov 07, 2002 at 02:22:08AM +0900, Daniel Bretoi wrote:

open source file for reading
open target file for writting
while not eof(source)
read source
write target
end

not even mentioning error checks.

Dalibor Sramek


Dalibor Sramek “In the eyes of cats, all things belong to cats.”
dali@insula.cz


A.D. 1844: Samuel Morse invents Morse code. Cryptography export
restrictions prevent the telegraph’s use outside the U.S. and Canada.