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.

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

-- 
Dalibor Sramek            "In the eyes of cats, all things belong to cats."
dali / insula.cz