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

Compress and uncompress directories using perl on Windows without disturbing the internal directory structure

by prerna1 (Initiate)
on Mar 14, 2012 at 17:41 UTC ( [id://959639]=perlquestion: print w/replies, xml ) Need Help??

prerna1 has asked for the wisdom of the Perl Monks concerning the following question:

there are 2 drives on windows 2003 server A: (Mapped filesystem , low storage , tape) G: (Local drive) I want to take a backup of a folder say "Backup" ( and its subdirectories) using compressing and uncompressing this folder and without disturbing the internal folder structure, that too using perl. please help
  • Comment on Compress and uncompress directories using perl on Windows without disturbing the internal directory structure

Replies are listed 'Best First'.
Re: Compress and uncompress directories using perl on Windows without disturbing the internal directory structure
by marto (Cardinal) on Mar 14, 2012 at 18:08 UTC

    You could look at using the Archive::Zip module (see also Archive::Zip::FAQ), and it's addTree method. See (Installing Modules from the Tutorials section). If one drive is low on disk space ensure you write zip files/temp files to a drive which isn't low on space. Windows allows you to browse and extract the contents of Zip files with Windows Explorer, thought Archive::Zip can also do extraction.

      Can you please provide a short coding for the same? " I do have a coding, but its not working on Windows in shell script" tar cpf - sp |(chdir ${A}\\${B}\\Base; tar xpf -)

        The second link I provided has working code.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2024-04-24 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found