Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: moving files

by perlcgi (Hermit)
on May 24, 2000 at 21:35 UTC ( [id://14614]=note: print w/replies, xml ) Need Help??


in reply to moving files

Using an upload like this just add something basic like the following
my $target = "/tmp/whatever"; open (OUTFILE, ">$target") or die "Could'nt open $target:$! \n"; print OUTFILE $file; close;
If you are using NT or an OS that distinguishes binary mode from test files add binmode OUTFILE; after the open statement above.

Replies are listed 'Best First'.
Printing into files clobbers the file time
by Corion (Patriarch) on May 25, 2000 at 12:14 UTC

    Using binmode is always good practice, regardless of the OS you're programming for - it has no overhead on systems that don't need it AFAIK

    Your proposed method of printing into the new file has the drawback (or the effect) that neither the original file time nor the original file attributes (as they are on the file system) get preserved.

RE: Re: moving files
by perlcgi (Hermit) on May 24, 2000 at 21:45 UTC
    Sorry about the typo:
    an OS that distinguishes binary mode from test files
    should read
    an OS that distinguishes binary mode from text files.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://14614]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2024-04-24 02:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found