aboutsummaryrefslogtreecommitdiff
path: root/lib/os/testdata
AgeCommit message (Collapse)Author
2026-02-03lib/os: fix IsBinary that return true if file size less than 1024Shulhan
If file size less than half of 1024, the rest of bytes will be `0` and it will counted as binary character.
2023-04-08lib/os: merge some functions from lib/ioShulhan
Functions like Copy, IsBinary, IsDirEmpty, IsFileExist, RmdirEmptyAll are read and operate on file and directory on operating system level, so it is not correct to put it in package io.
2022-09-15lib/os: add test of Stat and LstatShulhan
2022-02-02lib/os: implement function to Extract compressed and/or archived fileShulhan
The Extract function uncompress and/or unarchive file from fileInput into directory defined by dirOutput. This is the high level API that combine standard archive/zip, archive/tar, compress/bzip2, and/or compress/gzip. The compression and archive format is detected automatically based on the following fileInput extension: * .bz2: decompress using compress/bzip2. * .gz: decompress using compress/gzip. * .tar: unarchive using archive/tar. * .zip: unarchive using archive/zip. * .tar.bz2: decompress using compress/bzip2 and unarchive using archive/tar. * .tar.gz: decompress using compress/gzip and unarchive using archive/tar. The output directory, dirOutput, where the decompressed and/or unarchived file stored. will be created if not exist. If its empty, it will set to current directory. On success, the compressed and/or archived file will be removed from the file system.