LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 04-13-2009, 11:06 PM   #1
jblevins
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Rep: Reputation: 0
Tar archive from windows to linux, binary file issue


I have a tar file that I created on a windows server that contains source code (text & binary files). When I extract the archive everything appears to extract out normally except that any binary files are now corrupt. I used binary mode sftp to get the archive to the linux server so I know that is not the problem. Is there an option with tar -xf that prevents this issue when extracting files? Or could it be that I need to do something at creation of the archive that prevents this issue?
 
Old 04-13-2009, 11:21 PM   #2
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by jblevins View Post
I have a tar file that I created on a windows server that contains source code (text & binary files). When I extract the archive everything appears to extract out normally except that any binary files are now corrupt. I used binary mode sftp to get the archive to the linux server so I know that is not the problem. Is there an option with tar -xf that prevents this issue when extracting files? Or could it be that I need to do something at creation of the archive that prevents this issue?
This has nothing to do with the files being binary or anything like that.

In first place, if the tarball was corrupted at all you wouldn't even be able to uncompress it. The files you get when extracting should be 1:1 the same than they were when compressing.

How do you know that the binaries inside the tarball are corrupted at all?? What are the symptoms? Are they binaries for windows or for linux?
 
Old 04-13-2009, 11:39 PM   #3
jblevins
LQ Newbie
 
Registered: Apr 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
This has nothing to do with the files being binary or anything like that.

In first place, if the tarball was corrupted at all you wouldn't even be able to uncompress it. The files you get when extracting should be 1:1 the same than they were when compressing.

How do you know that the binaries inside the tarball are corrupted at all?? What are the symptoms? Are they binaries for windows or for linux?
I would like to agree with you but the binary files put into the archive are fine when added, but after extraction and opening one I get a corrupt file. The binary file I am using to test are images. So I am just trying to open them with an image viewer. Files I tried are .png & .bmp After I extract the archive I binary sftp them back to my windows machine and they are no good.

These files are from a cvsnt repository. Originally all these files were located on a linux cvs server, but due to a failure I moved them to cvsnt thinking that I would just use windows going forward. Well it is a long story but now I am moving them back to a linux cvs server. I am aware of the issues of trying to do this, but we only used the cvsnt server for about 2 months and we did not use any cvsnt specific features so the data should be fine.

Anyway for the life of me I can't figure out why the binary files are corrupt just moving them to linux fs. I guess I could just move a file directly from the windows box to linux box and see if it get corrupted. This would rule out taring as the culprit.
 
Old 04-13-2009, 11:50 PM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,083

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Quote:
Originally Posted by jblevins View Post
I would like to agree with you but the binary files put into the archive are fine when added, but after extraction and opening one I get a corrupt file. The binary file I am using to test are images. So I am just trying to open them with an image viewer. Files I tried are .png & .bmp After I extract the archive I binary sftp them back to my windows machine and they are no good.
Then the only plausible explanation is that somehow they get corrupted before they are tarred in the windows machine. Or... they are corrupted after they are uncompressed in the linux machine. It's the only thing I can't think of.

Mind that even if a single byte gets screwed on the tarball file while you are transmitting it you will never be able to uncompress it. Tar will just exit with an error.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Piping tar bzcat to add a file to a tar.bz2 archive DaveQB Linux - Software 0 06-02-2008 08:28 PM
tar is not compressing archive file BajaNick Linux - Software 5 06-16-2007 11:21 PM
file = posix tar archive JsCAMRY Linux - Hardware 1 01-26-2007 09:41 AM
Tar gives error when creating a tar file archive davidas Linux - Newbie 10 04-13-2004 12:35 AM
tar - how to extact only a single file from a archive? bkeating Linux - Newbie 3 10-23-2003 03:42 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 07:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration