Commit Graph

7 Commits

Author SHA1 Message Date
Nico Weber
430b265cd4 AK: Rename KB, MB, GB to KiB, MiB, GiB
The SI prefixes "k", "M", "G" mean "10^3", "10^6", "10^9".
The IEC prefixes "Ki", "Mi", "Gi" mean "2^10", "2^20", "2^30".

Let's use the correct name, at least in code.

Only changes the name of the constants, no other behavior change.
2020-08-16 16:33:28 +02:00
Ben Wiederhake
0248ddc427 Userland: Mark compilation-unit-only functions as static
This enables a nice warning in case a function becomes dead code.
2020-08-12 20:40:59 +02:00
Ben Wiederhake
538a3a2579 Userland: Add missing checks for MappedFile.is_valid() 2020-07-31 11:34:06 +02:00
AnotherTest
d6c7cdce98 unzip: Correct compression method offset value 2020-07-14 12:05:37 +02:00
AnotherTest
3a7a689b87 unzip: Remove some magic numbers and create directories when needed
This commit also adds an assert about the compression method instead of
just writing out the compressed data.
2020-07-13 15:28:54 +02:00
AnotherTest
6a265f7c21 unzip: mmap() the zip file if possible to avoid spamming syscalls
This patch makes `unzip' mmap the zip file instead of seeking the file
repeatedly.
This makes unzipping big files bearable, and unzipping huge files
impossible.
The later could be fixed by mapping/unmapping chunks on the fly once we
have support for mmap() offsets.
2020-07-13 15:28:54 +02:00
Andres Vieira
7433210fa6 Userland: Add unzip command
The unzip command will unzip a zip file passed as an argument into the
current pwd, with the syntax:
   unzip file.zip

This implementation is pretty barebones as it does not support things
like file access times, compression or even compression detection, so
if the user tries to unzip a compressed zip most probably he would find
wrong data inside the files.

However it's an starting point :^)
2020-05-09 23:50:44 +02:00