Should archive files, such as .zip and .tar.gz packages, store their content inside a single, top level (root) directory?
Displaying poll results.11236 total votes.
Most Votes
- Will ByteDance be forced to divest TikTok Posted on March 20th, 2024 | 9422 votes
- What's the highest dollar price will Bitcoin reach in 2024? Posted on February 28th, 2024 | 8491 votes
Most Comments
- What's the highest dollar price will Bitcoin reach in 2024? Posted on February 28th, 2024 | 68 comments
- Will ByteDance be forced to divest TikTok Posted on February 28th, 2024 | 20 comments
Re:Why would you want this? (Score:5, Insightful)
Both zip and tar already do, and have for years. I think that's why the poll is getting blind stares rather than responses.
Re:Why would you want this? (Score:5, Insightful)
I interpreted it as "should there be a single top-level directory first, followed by the entire directory tree," as opposed to having an "exploding zip" that, when you select "extract to current directory" from your mid-to-late-90's zip program, will likely flood your downloads folder with junk.
I selected "Don't care," because this really isn't an issue for me. I use 7zip to extract to a new directory, and then move things as appropriate afterwards. The location I first extract to is typically not the final resting place for the data anyways, so it really isn't any extra effort. When in Unix environments I follow a similar pattern, but do it from the command line.
Re: (Score:2)
I interpreted it as "should there be a single top-level directory first, followed by the entire directory tree,"
Me too, and my answer to that interpretation is that there damn well better be. So obnoxious to have to always untar inside a new directory, in case there isn't, and then move the tree up and rmdir if there is, every single time.
Re: (Score:2)
Store? Hell no!
Have the option to decompress into one? Of course!
Have most had it for years? Yup.
Is this a strange poll? I guess.
Wrong population to survey? (Score:2)
Or is this really a meta-poll to see how many people will still respond to the most inane poll imaginable?
Do I get bonus kudos for the supplementary comment? Or did I lose all my kudos for failing to pick the top option? Double or nothing on the next poll? Unless this was the last one.
Re: Why would you want this? (Score:1)
Re: (Score:2)
I read it the exact opposite way: that subhierarchies should start at the root of the archive. So I answered no, meaning that it's good practice to have archives only write into a single directory when extracted.
Re: (Score:2)
I interpreted it as "should there be a single top-level directory first, followed by the entire directory tree...
That is also how I understood it.
Re: (Score:2)
Of course, all files should not be dumped into a single top level folder.
Oh, ah! You mean, should the entire top level contents BE only a top level folder, with a hierarchical tree beneath it?
I love to unzip things to get hold of what is inside.
But maybe unzipping programs could WARN you that you're about to explode a bunch of files into the current directory? Or maybe the unzipping program co
Re:Why would you want this? (Score:5, Insightful)
I think what it means is should the root of the archive be a single directory with the rest of the directory structure inside that, or should the root contain multiple files/directories.
In the former case if you extract the archive you get a directory with its contents inside. In the latter it sprays out its contents in the current directory.
This is the wrong question though. The correct answer is that every program extracting these archives should have an option to detect if the root consists of a single directory and if so extract it, or if no make a directory and extract the contents into that.
Re: (Score:2)
At one time that annoyed me, but since the convention is consistent, I can deal with it and it's not a big deal. If I want a single directory with ZIP, then I create a directory first, problem solved.
Re: Why would you want this? (Score:1)
Re: Why would you want this? (Score:1)
Actually, .zip and .tar are flat lists of files, each file has a full path that is parsed to create the directory structure. They are formatted like this so you can append to them without having to rewrite any data (just the terminating record).
Re: (Score:2)
Unicode. Itâ(TM)ll happen to you one day.
Well, it still hasn't happened to Slashdot
Re: Why would you want this? (Score:2)
Don't think of it as a container in a container, but a compressed container and its corresponding uncompressed container.
WHY WON'T THE DANG COMMENTS LOAD?!?!?! (Score:2, Funny)
Are you kidding? (Score:2, Insightful)
What kind of stupid question is this?
Re: (Score:1)
I agree - looking at this question is like seeing a fish on a bicycle - doesn't make any sense whatsoever.
Re: (Score:2, Insightful)
Analogy:
Seriously fuck this poll question. The answer depends on your use case. When I'm making my own backup/archive, I usually preserve full path. When someone gives me a zip/tar file, one of the first things I'm going to do before extracting it is look to see if any of the internal paths start with a leading slash, so I'll kn
Re: (Score:2)
A. black socks.
This is the correct answer. Always.
Re: Are you kidding? (Score:2)
Said the AC who was such an ignoramus he did an extraction in a directory he cared about, without first learning what the extraction tool would do. Maybe he should have made a directory for extraction? Does he sometimes squat and shit in his pants instead of using a toilet?
Re: (Score:2)
Anyone who has experience on Unix reads the man pages and knows how to control archives
Comprehension (Score:2, Funny)
Okay, so you get a zip it 7z file and extract the contents to a folder created for the contents. Except now it's a folder inside a folder because some fool zipped a folder. Won't fool me again, so next time I extract it to the top directory, except now there is not a folder and all your new files are shrapnel spread out over the entire folder. Why isn't there a standard for these things?
Re: (Score:3)
AC nailed the point of this question, even though the question was phrased poorly and, IMO, isn't asking anything useful.
Are there times when an archive file such as zip or .tar.gz should explode multiple files into the CWD (current working directory)? /usr/local/something/blah and /etc/something).
- YES. For example, to restore from an archive and overwrite directly to the filesystem (ex. so it'd contain
Should normal archive files, such as of program source code, or a collection of letters, etc, explode mul
Re: (Score:2)
I have a special unzip dir usually named tmp, that unzip in. If the archive was wellbehaved I just move the directoy out of the temporary dir. If the archive was made by assholes, I just have to rename the temporary dir.
Re: (Score:2)
So I thought the question was asking if the internal structure of an archive file be organized so that an index of all the file and directory information is located at the top of the file, followed by the blobs of data that represent the content of said files? Or should the internal structure be a series of tagged blobs in a linked list, i.e. "next_file_offset=50:path_1:file_name_1:file_content_1"; "next_flie_offset=230:path_2:file_name_2:file_content_2"; etc.?
Someone might ask this with the idea that a to
Re: (Score:2)
Always make the folder. Or use a tool that creates one to be safe, then moves the single directory out of there if it wasn't actually required. Hell, write one -- everyone hates Perl, right?
Answer: In many cases but not always. (Score:2)
Who cares? (Score:2)
Personally, I don't care.
However, as in all of these kinds of question, the answer is really "it depends!"
Depends on what? What your archiving tool is trying to do. If you are looking for best case compression, stuffing as many bits as you can into the smallest space, then having some directory data on the front may not be a good idea. You want to compress fast? Again, it may not be a good idea to provide a directory in a separate space in the front, might slow you down during compression... However,
Re: (Score:1)
What ever Cowboy Neal says (Score:5, Funny)
Except he is not on this poll. Poor Natalie must be crying so much into her Grits that they are no longer hot.
Use BagIt (Score:2)
https://en.m.wikipedia.org/wik... [wikipedia.org]
At the top level is metadata and checksums, with a 'data' directory with the actual content
What do you mean? (Score:2)
Depends on what you mean... Could'nt really understand the question and I sense I'm not the only one.
Like this?
$ tar ztf pak1.tar.gz
content/
content/fubar.c
content/foo/
content/foo/bar.h
content/cowboy.neal
YES!
Or like this?
$ tar ztf pak2.tar.gz
cowboy.neal
foo/
foo/bar.h
fubar.c
NO!
$ tar ztf pak3.tar.gz
bar.h
cowboy.neal
fubar.c
ABSOLUTELY NOT!
Re: (Score:2)
Re: (Score:2)
Re: (Score:3)
I tried to run Right click, but bash tells me "command not found"... Which deb package is it in?
Re: (Score:2)
You forgot the .mac folder that gets created in the root anyway, because Mac developers are wankers, and archive you just unzipped had been near a wanking mac.
It's easy enough to look inside them first (Score:1)
and I've taken to doing so semi-automatically after having stuff splattered allover places like /usr/local/share/ or such a couple of times.
Re: (Score:2)
it takes less time when there would be a standard. However, it is less complicated to have a single root directory in the archive, as this would not require to create a directory before unpacking.
Either (Score:2)
I'm fine either way... as long as I know ahead of time which it is!
DOS 1.0 had this feature (Score:2)
MS DOS 1.0 had this feature. All files were in the root, there were no folders. People quickly discovered that once you have more than a few files, you want to organize them into folders. Duh!
I use 7zip to back up my hard drive. It "just works." I get a zip file that's 100 GB, but it's a format I can trust, and won't change with each new version of the backup software. Take away folders, and this use case will no longer "just work."
This is the weirdest slashdot poll in a long time!
Re: (Score:2)
Do you like it when you unpack an archive and it takes a shit all over your directory?
No.
But a better question would be "Should archive files be created by various users with all of their content in a top level directory?" And the answer should be "It depends." Sometimes unpacking a .zip or .tar file is done to update an existing file/directory structure. Sometimes it is done to package and distribute new content. In either case, the creation of the archive should take it's use case into account.
I am in the habit of creating my own subdirectory into which I unpack new stuff. It saves me fr
Re: (Score:2)
This is the "I do not use Linux/Unix and I do not know what tar.gz means". While the yes option refers to people who know how to make packages and they are usually knowledgeable in Unix-wizardry and a curse to the proprietary realm. As it looks like, the dark side wins by 13%, as so many people do not care about efficiency and elegance.
Re: (Score:2)
Do you like it when you unpack an archive and it takes a shit all over your directory?
I agree that the default behavior should be to put all the extracted files in a subdirectory but there are plenty of times where this might not be the desired behavior and there should be a flag to allow it to extract to the current directory without creating a subdirectory.
Might I suggest the flags --safedir and --unsafedir or something similar where you know --safedir means everything will always go into a single directory.
Car analogy (Score:2)
It's easy to solve ... (Score:3)
Solved. Now why isn't this implemented in every OS yet?
More importantly... (Score:2)
Should poll questions make sense?
__ Yes
__ No
__ CowboyNeal
Sorry, you can't do this. (Score:2)
Re: (Score:2)
It depends (Score:1)
It is not practical to create a subdirectory to compress just one file. But if there are more than 3 files, they should definitely be in a subdirectory.
A better solution (Score:2)
Re: (Score:1)
But...but, what about (Score:1)
CowboyNeal?
Depends (Score:2)
If an archive contains multiple files or a directory tree, then yes, there should be a root directory to avoid exploding the download location with archive contents. If, however, an archive contains a lone, unified file (which is probably already compressed, so why archive to begin with, but I digress), then no, there should not be an additional directory layer containing that lone file.
I've come across archives that violate both general rules, but compared to what are often problems with the quality/usabil
Re: (Score:2)