Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: IO::Compress::Gzip file close issues

by pmqs (Friar)
on Jul 26, 2016 at 22:44 UTC ( [id://1168601]=note: print w/replies, xml ) Need Help??


in reply to IO::Compress::Gzip file close issues

Under the hood IO::Compress::Gzip only uses Perl IO. It does use an extarnal library for the compression, but not for the IO.

That means that once this line of your script has been run

gzip $archfile => "$archfile.gz", AutoClose

the file referenced by $archfile will have been closed. What is the value of $! when unlink fails?

Also, does any other process have $archfile open? You cannot delete a file on windows if a proces has it open.

Replies are listed 'Best First'.
Re^2: IO::Compress::Gzip file close issues
by Paul.Unix (Novice) on Jul 27, 2016 at 08:50 UTC
    The $! is "Permission denied". The second unlink after 2 seconds sleep succeeds. First I did not check on the unlink status and the same issue was with moving the newly created .gz file. I noticed that if the move of the .gz file failed also the unlink had failed. That is why it seems to me that the file close is not completed after the gzip yet.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-25 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found