The safety of my data and ease/speed of handling single file viewing, adding, etc. zip format offers more data safety than 7z and much better DE-compress speed for a file or two, or adding or deleting files. Unless 7z is compressed with blocking and recovery code added, then the entire archive of files would likely be lost.įor my use, I think that the. zip, the remaining files are likely still recoverable. It can decompress just the file name index so you can choose one or more files to extract.7z would have to decompress the entire archive every single time and then re-compress the entire archive, if that were needed (adding a file, for instance).Īlso, if there is damage to a file in the archive, with. If you want to look at one or several files (rather than decompressing the entire archive) or to add, change, or remove files, then you would want the.zip format because it can do that. If you're wanting smallest archive possible and will want ALL the files in the archive at once (all or nothing), and you're okay with losing everything if any part of it is corrupted (or adding blocking and recovery code, making the file larger), then 7z would be fine. It depends on how you want to use the archive. It is taking me about 12 minutes to create and 8 minutes to unpack. (the resulting archive is about 760MB and about 176K files). I am using Powershell to do the commands. What I want is the fastest elapsed time - for creating the archive and especially for the unpack of the archive. But the listing of the archive, shows that solid is off.īut my really question is what is the fastest way to archive with 7zip, solid or not solid. 7z file, with the -ms=on flag, which is supposed to result in a solid archive. To zip single directory import archiver from 'archiver' However, if you don't really care to understand the native methods and introducing a new dependency is a non-issue, this is also a valid option. Use a third party library/module (of which there are plenty on NPM). Do a quick google search or go to the creator, Info-ZIP's, website for downloadable binaries. The ZIP utility is tried and tested for decades, it's fairly ubiquitous and it's a safe choice. Obtain the zip binary for your OS/distribution. This is a nice option as you don't need to install anything new onto your operating system or manage another dependency (kind of the whole point for this answer). For example, linux distros usually come with tar/ gzip utilities: Replace the shell command in the above Node.js code with code from your system. Work with the archiving/compression utility that is native to your platform In that case you have at least three options: For completeness sakes, some operating systems may not have utility installed by default. Therefore, this example assumes you have the zip utility installed on your system. This question is specifically asks about the zip utility for archiving/compression purposes. There are a lot more options you can specify other than cwd to further fine-tune your request. You can also use child_process.exec(path, options, callback) if you want async behavior. The example above showcases the synchronous API. const child_process = require("child_process") Use Node's native child_process api to accomplish this.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |