Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Creating a tgz file without a module

by blue_cowdawg (Monsignor)
on Sep 08, 2011 at 16:05 UTC ( #924849=note: print w/ replies, xml ) Need Help??


in reply to Creating a tgz file without a module

      So the question is, can this be done without using Archive::Tar or any other modules? I'm unable to install any modules on this system, thus the problem I'm facing.

Since you have not specified what environment (WinBloze, *nix, *ix or Macinsquash) I am going to answer with a *nix filter.

To directly answer your question:

| hand waving here... system("tar cf tarfile.tar file1 file2 ... filen"); system("gzip -S tgz tarfile.tar");

But wait! I'm not going to let you off the hook that easily.

If you are running in a *nix environment you can install modules on your environment by putting them someplace in your HOME directory and then referencing that location with the use lib pragma. WinBloze I can't answer for since I don't do windows.


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg


Comment on Re: Creating a tgz file without a module
Select or Download Code
Re^2: Creating a tgz file without a module
by rspishock (Monk) on Sep 08, 2011 at 16:23 UTC

    Thanks for the response. I had actually tried to use the

    system "tar zxvfP ....
    line but didn't think it worked since I couldn't find the tgz file which should have been created. Long days on top of lack of sleep tends to have a negative effect on your thinking. Anyway, if nothing else, you've verified that I was originally thinking along the right track.

    For what it's worth, when I said that I can't install a module, it wasn't because of a lack of ability to locate it, it's because of the process I'd have to go through to get it approved to add to my system. Ultimately, it would probably take a long time to get done.

    Thanks again for the guidance.

          ne but didn't think it worked since I couldn't find the tgz file which should have been created

      Try looking for a file ".tar.gz" instead! :-)

          it's because of the process I'd have to go through to get it approved to add to my system. Ultimately, it would probably take a long time to get done.

      Sounds like some form of Change Manglement err.. Management process to me.

      If you have to do this sort of thing on a regular basis (tar up files) I'd say it would be worth the time and trouble get the approvals. I've been there done that and feel your pain.

      In my humble opinion using system is at best a bandaide. I'd rather take the time and trouble to get a job done right in the long run than accept the idea that I can't because of paperwork.


      Peter L. Berghold -- Unix Professional
      Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg

        I couldn't agree more, I'd rather write the code and make sure it's going to work instead of coming up with a temporary solution. I'll look around to see if I can either get Perl updated to 5.10 or at least get the module added. </P

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (12)
As of 2014-11-26 20:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (173 votes), past polls