summaryrefslogtreecommitdiff
path: root/Userland/Utilities/file.cpp
AgeCommit message (Collapse)Author
2022-08-16Utilities/file: Handle all supported audio MIME typeskleines Filmröllchen
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-04-11Utilities: Read positional arguments as Strings not char*sSam Atkins
This is a pretty trivial change so they're all batched together.
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-01-13LibELF: Accept Span instead of Pointer+Size in validate_program_headersIdan Horowitz
2022-01-13LibELF: Use StringBuilders instead of Strings for the interpreter pathIdan Horowitz
This is required for the Kernel's usage of LibELF, since Strings do not expose allocation failure.
2021-12-21file: Add description & image details for image/x-qoiLinus Groh
2021-12-16file: Port to LibMainKenneth Myhra
2021-11-23LibCore+AK: Move MappedFile from AK to LibCoreAndreas Kling
MappedFile is strictly a userspace thing, so it doesn't belong in AK (which is supposed to be user/kernel agnostic.)
2021-10-21Userland: Teach the file utility more about ELF filesValtteri Koskivuori
It now shows some useful at-a-glance information about ELF files, like it does on other *nix systems.
2021-07-27LibGfx: Improve ImageDecoder constructionAndreas Kling
Previously, ImageDecoder::create() would return a NonnullRefPtr and could not "fail", although the returned decoder may be "invalid" which you then had to check anyway. The new interface looks like this: static RefPtr<Gfx::ImageDecoder> try_create(ReadonlyBytes); This simplifies ImageDecoder since it no longer has to worry about its validity. Client code gets slightly clearer as well.
2021-06-15Userland: Teach the file utility that empty files also existValtteri Koskivuori
Previously, empty files with no identifiable file type extension would show up as `text/plain`. This fixes it up to show empty files as what they really are - full of nothing.
2021-05-27file: Output directory when path is a directoryArjan Zuidema
Before file would output 'text/html' when the path was a directory.
2021-05-24LibCore+Userland: Add 13 more detectable file typesValtteri Koskivuori
This patch adds 13 new detectable file formats, which are as follows in alphabetical order: .blend, .isz, ext* filesystem, Lua bytecode, Matroska container, NES ROM, .pdf, qcow image, .rtf, WebAssembly bytecode, Windows 3.1X/95 compressed archive and raw zlib stream Some are a tad esoteric, but the more file types we detect, the more useful this utility becomes! :^)
2021-05-18LibCore+Userland: Add two more detectable formatsValtteri Koskivuori
Second batch of detectable formats, this time with verious offsets, as enabled by the previous commit. This adds tar, and the three signature variants for iso-9660 image files.
2021-05-18LibCore+Userland: Add 5 more detectable filetypesValtteri Koskivuori
This adds gzip, sqlite, 7-Zip, flac and midi.
2021-05-12LibCore+Everywhere: Move OpenMode out of IODeviceAli Mohammad Pur
...and make it an enum class so people don't omit "OpenMode".
2021-05-07Utilities: Use GzipDecompressor::describe_header for gzip descriptionsIdan Horowitz
2021-05-07file: Clean up mime type enumeration macroLinus Groh
- Improve naming - Order alphabetically - Remove duplicates
2021-05-07file: Remove unused static description stringsLinus Groh
2021-05-07file: Don't exit immediately after file open errorLinus Groh
Instead just remember that a file failed to open, carry on and return 1 at the end.
2021-05-07file: Remove redundant value_or({})Linus Groh
2021-05-07file: Avoid some unnecessary string copiesLinus Groh
2021-05-07Userland: Implement a file utilityValtteri Koskivuori
This unix classic attempts to classify and identify information about given files based on various heuristics. In this case, we're relying on the Core::MimeData detector for file type and LibGfx::ImageDecoder for additional metadata if the given file is an image. It's very simple for now, but adding new detectors should be quite easy.