Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: archive::zip how to delete files after creating the zip.

by lithron (Chaplain)
on Jun 30, 2013 at 03:27 UTC ( #1041542=note: print w/replies, xml ) Need Help??

in reply to archive::zip how to delete files after creating the zip.

Are you looking for unlink?
unlink 'file01.dat';

Replies are listed 'Best First'.
Re^2: archive::zip how to delete files after creating the zip.
by rjt (Deacon) on Jun 30, 2013 at 09:11 UTC

    Are you looking for unlink?

    I doubt the OP was looking for unlink, as they specifically asked how to delete files and directories, and unlink only deletes regular files1.


    1 unlink can delete directories under certain somewhat unusual conditions, but such use is not recommended. From unlink:

    Note: unlink will not attempt to delete directories unless you are superuser and the -U flag is supplied to Perl. Even if these conditions are met, be warned that unlinking a directory can inflict damage on your filesystem. Finally, using unlink on directories is not supported on many operating systems. Use rmdir instead.

    rmdir only deletes empty directories, and its documentation specifically suggests File::Path, as I've already suggested.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041542]
Discipulus yaaawn..
[Corion]: DST does that to everybody...
Corion attempts to find who to address to better target his drive-by patches
[Corion]: This time it's for the Duktape embedded Javascript engine, which would be nice to have IMO, but doesn't compile on Windows currently
[Corion]: I imagine it would be fun to have WWW::Mechanize:: Duktape, but I haven't seen a web browser written in Javascript yet, except the ones distributed with PhantomJs

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2017-03-27 11:07 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (319 votes). Check out past polls.