Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tar windows file, help pls

Status
Not open for further replies.

hendnov

Technical User
Feb 27, 2006
73
AU
Hi guys, do you know best software to tar windows file?

I've tried cygwin, but after I tarred in cygwin and I tried to extract in UNIX server. It said permission denied, I already changed the mode. But it didnt help..

any solution ?

THX GUYS
 
I think that Cygwin is a good choice, since it's already set up. I've been using it that way for a long time now. So, let's identify the problems with that...

First, before creating the tar file in Cygwin, use the command [tt]chmod -R 777[/tt] on the file or directory you want to tar up.

If your tar file was created on your Windows box with an absolute path to a directory you don't have permissions to on the Unix box, that would cause the error message.

If your tar file contains a relative path to a directory you don't have permissions to on the Unix server, that would cause the error message.

If you don't have write permissions to the directory you're trying to un-tar the file to, probably the directory you're in, that would cause the error message.

--
-- Ghodmode
 
Hi Ghodmode,

I think Im in second case which is :
"If your tar file contains a relative path to a directory you don't have permissions to on the Unix server, that would cause the error message"

I've seen the files content is all set : rw-------

But I couldnt changed it to 777,
when I type chmod -R 777 *

seems work, but when I checked the files. the mode are still the same...

so,... any idea?
 
When you typed [tt]chmod -R 777[/tt], it was in the Cygwin console on the Windows box, right?

You need to find the real folders that the folders in your Cygwin console map to.

I think, in Cygwin, your home is c:\cygwin\home\<name> and your root is c:\cygwin. Everything on drive C, relative to the Cygwin console is below /cygdrive/c. That might not be exactly right, but it's close. Change those files' permissions using Explorer (not IE, the regular file explorer).

If that fails (this has happened to me), you will have to use the venerable Windows Command Prompt (Start -> Accessories -> Command Prompt) with the attrib command. Find the offending files and use the command [tt]attrib -r[/tt], then [tt]attrib -s[/tt] on each of them. It's a tedious process and, as far as I know, Windows/DOS batch file scripting is incapable of speeding it up.

When you untar the file, does it create some of the files, just not all of them? It occurs to me that it might create a directory you don't have write or execute(search) permissions to, then try to extract files from the same tar file to the directory it just created. It could create the directory, but not the files because of the directories permissions. This means you would have to untar, then [tt]chmod -R[/tt] the new directory, then untar again.

These are just some ideas. I don't think that the problem lies with the tar program you use, but in interpretation of the file and directory permissions. Effectively, you're root in your Cygwin console, so you can tar files that you can't read. But you're not root on your Linux box, so you can't untar them.

--
-- Ghodmode
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top