LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-24-2015, 01:07 PM   #1
stacky412
LQ Newbie
 
Registered: Dec 2014
Posts: 3

Rep: Reputation: Disabled
Question Use of tar files


I recently installed VMWare workstation on my computer. However due to some kernel compatibility issue, I had to patch my installation in the /usr/lib/vmware/modules/source/ directory. Funny thing is, all the files there are tar archives So to patch I had to decompress, patch, then compress again.

My question is, how exactly do programs use these files as tarballs? Do they dynamically compress and decompress during runtime? Are they read as is?

Thanks in advance.
 
Old 02-24-2015, 07:29 PM   #2
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,023

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Almost no way usually to use a tar.(compressed) file for most uses.

In this case it does look like when you run the final vmware-modconfig --console --install-all it then can look into that file and get the new patched information.

Good question and I hope I am right on that.

Hello and welcome to LQ also.


See this but I assume you already used it. https://wiki.archlinux.org/index.php/VMware
 
1 members found this post helpful.
Old 02-24-2015, 08:47 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,403
Blog Entries: 28

Rep: Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166
I think man files are gzipped and decompressed upon access.

Code:
$ ls /usr/share/man/man1
411toppm.1.gz                      gvfs-set-attribute.1.gz           pi1toppm.1.gz
CA.pl.1.gz                         gvfs-trash.1.gz                   pi3topbm.1.gz
FvwmAnimate.1.gz                   gvfs-tree.1.gz                    pic.1.gz
FvwmAuto.1.gz                      gvfsd-fuse.1.gz                   pic2graph.1.gz

(snip)
I have never investigated how it works, though. The answer might be in

Code:
man man
but I'm too tired to read it right now.

Last edited by frankbell; 02-24-2015 at 08:50 PM.
 
1 members found this post helpful.
Old 02-24-2015, 10:04 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,023

Rep: Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632Reputation: 3632
Or maybe the file is never really un-compressed except in that the data is removed.
 
1 members found this post helpful.
Old 02-24-2015, 10:28 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,403
Blog Entries: 28

Rep: Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166Reputation: 6166
Quote:
Or maybe the file is never really un-compressed except in that the data is removed.
I suspect that is uncompressed in the same way as a compressed file is uncompressed when you click "View File" in a file manager--that is, it is extracted to RAM for viewing, but not extracted to disk. Nevertheless, it does seem to indicate that compressed files can be uncompressed and used in real time.

As I said, I don't know how it works. I just know it does.
 
1 members found this post helpful.
Old 02-25-2015, 06:52 AM   #6
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,885
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Quote:
Originally Posted by stacky412 View Post
I recently installed VMWare workstation on my computer. However due to some kernel compatibility issue, I had to patch my installation in the /usr/lib/vmware/modules/source/ directory. Funny thing is, all the files there are tar archives So to patch I had to decompress, patch, then compress again.

My question is, how exactly do programs use these files as tarballs? Do they dynamically compress and decompress during runtime? Are they read as is?

Thanks in advance.
Are you implying that it only works if you leave the tarballs there?

There's nothing wrong with receiving new code or a patch in a tarball, decompressing it, performing the update, and then in my experience, the tarball and usually the decompressed content are no longer relevant except to keep for future reference.

What frankbell says about man pages is true by my opinion as well.

Further, I have custom software which uses a .tar.bz2 file; however it extracts the files, performs a specific function, and then removes the original file. It's used for a product upgrade process and I wrote it to operate in a specific fashion. So it's really up to the coder, however for kernel patches, things are probably done in a near uniform manner due to the submission to a public repository.

Last edited by rtmistler; 02-25-2015 at 06:55 AM.
 
Old 02-25-2015, 08:18 AM   #7
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,537

Rep: Reputation: Disabled
The utility tar can look into, & copy out of an archive without decompressing it.
(It can also add files into a compressed archive.)
As for .gz files there are utilities with a z prepended, (in /bin) that can operate on compressed file archives.
 
Old 02-25-2015, 09:53 AM   #8
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by fatmac View Post
The utility tar can look into, & copy out of an archive without decompressing it.
(It can also add files into a compressed archive.)
As for .gz files there are utilities with a z prepended, (in /bin) that can operate on compressed file archives.
I say tar only makes an archive of files and directories and not individually compressing files. Zip does that.

You can pass an option for compression like -j or -J or -z but they compress the whole archive and decompress the whole archive.
 
Old 02-28-2015, 08:53 AM   #9
stacky412
LQ Newbie
 
Registered: Dec 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Smile

Quote:
Originally Posted by rtmistler View Post
Are you implying that it only works if you leave the tarballs there?

There's nothing wrong with receiving new code or a patch in a tarball, decompressing it, performing the update, and then in my experience, the tarball and usually the decompressed content are no longer relevant except to keep for future reference.
Not quite, I wasn't referring to the relevance of the tarballs. I was looking for an explanation as to why the tarballs are all there is. Even more interesting was that applying the patch actually required updating files in one of the tarballs.

Thanks.
 
Old 02-28-2015, 08:58 AM   #10
stacky412
LQ Newbie
 
Registered: Dec 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
It seems what frankbell and jefro referred to might be what is actually going on. Thanks :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
compile and installation of .tar.bz2/.tar.gz files jmenew Linux - Newbie 14 01-04-2013 02:53 AM
Why joining parted *.tar is missing files, when *.tar itelf have them? UltraMC Linux - Newbie 1 06-27-2012 01:53 PM
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 5 11-08-2010 11:02 AM
More tar issues - listing files in a single tar from a multivolume borks Thymox Linux - Software 4 09-23-2009 07:48 PM
tar -zxvf foo.tar.gz creates all .gz files prophoto Linux - General 11 11-09-2006 06:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:20 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