Dermot Paikkos wrote:
> 
> I have been playing with the File::Temp module. I wanted to use it to
> create a temporary mount point on a file system then mount a
> remote dir into it and copy the files over.
> 
> I tried the following:
> use File::Temp qw/ tempdir /;
> .....
> $tempdir = tempdir();
> system("mount","-t","nfs","server:/usr1","$tempdir") || die "Can't
> mount into $tempdir: $!\n";
> 
> I always get the OS error "no such file or directory". The dir is made
> so i am not sure if this is an OS problem or a design feature.

system() returns zero on _success_ and non-zero on _error_ so that
statement will always die and the error is stored in $? not $!

system("mount","-t","nfs","server:/usr1",$tempdir) == 0
    or die "Can't mount into $tempdir: $?";

perldoc -f system


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to