Using the Unix 'tar' Command
Posted by: Len_Jacobson (---.hsd1.ca.comcast.net)
Date: January 22, 2012 01:43AM

I have a line of code that invokes the 'system()' function, and the command passed to the 'system()' function is the 'tar' command. This code works perfectly when I run it on my (Linux) production server; when I run it on the 'wampserver', I get an empty file as its output.

Can anyone tell me why this doesn't work and if there is a way to make it work?

Thank you very much.

Options: ReplyQuote
Re: Using the Unix 'tar' Command
Posted by: scarabaeus (---.dhcp.gsvl.ga.charter.com)
Date: January 22, 2012 03:48AM

Let's see...
The 'W' in wamp stands for 'Windows'.
The system() function invokes the local OS command processor.
The local command processor is Windows command processor.
I don't believe Windows has a native 'tar' command.

from Wikipedia:
"... Microsoft Windows includes neither graphical nor command-line tools for reading or creating these formats, requiring the use of third-party tools..."

...but I have been known to be wrong...

regards...



Edited 1 time(s). Last edit at 01/22/2012 03:49AM by scarabaeus.

Options: ReplyQuote
Re: Using the Unix 'tar' Command
Posted by: Len_Jacobson (---.hsd1.ca.comcast.net)
Date: January 22, 2012 07:52AM

You are absolutely right! I think I was "smoking something" when I posted this question. I left the house right after posting it and then it hit me ... the 'system()' function could only execute a Windows function, and, as you say, 'tar' is not one of them.

Thank you for responding and for giving a polite response (rather than telling me what I deserved to hear).

Options: ReplyQuote


Sorry, only registered users may post in this forum.