in reply to Re: moving files from folder1 to folder2
in thread moving files from folder1 to folder2

Why are you two talking about renaming the file? Am I not understanding what I'm asking? Is that what you'd need to do in order to transfer the file from one directory into another?

Would this be what I need?

use File::NCopy; # the below are the default config values $file = File::NCopy->new( 'recursive' => 0, 'preserve' => 0, 'follow_links' => 0, 'force_write' => 0, 'set_permission' => \&File::NCopy::u_chmod, 'file_check' => \&File::NCopy::f_check, 'set_times' => \&File::NCopy::s_times, ); $file = File::NCopy->new(recursive => 1); $file->copy "/home/fred/public_html/temp/image.gif","/home/fred/pu +blic_html/final/image.gif";

Replies are listed 'Best First'.
Re: moving files from folder1 to folder2
by Abigail-II (Bishop) on May 15, 2004 at 00:27 UTC
    Why are you two talking about renaming the file? Am I not understanding what I'm asking? Is that what you'd need to do in order to transfer the file from one directory into another?
    Oh, come on, show some initiative. Read the manual page, and learn what rename is about, and then try it out.

    Abigail

Re: Re: Re: moving files from folder1 to folder2
by haoess (Curate) on May 14, 2004 at 23:26 UTC

    What is your difference between moving and renaming? In UNIX language, you can rename a file if source and destination are in the same filesystem (aka partition). That's very fast, because only inode information is changed. If they are not: You copy the source file to destination and unlink the source file. That's the way it goes.

    If you use perl's rename, you should take care about this. That's why I pointed you to the CPAN module. It takes this care for you and does the same as mv(1) does (if renaming is not possible): Read the source file and write it to its destination.

    -- Frank