Commit graph

8 commits

Author SHA1 Message Date
Peter Elliott
f69b419c05 LibCore: Add File::{stdin, stdout, stderr}()
This should make it easier to get a Core::File for standard streams.
2020-08-21 12:26:30 +02:00
Sergey Bugaev
d89843f96f LibCore: Add File::read_link() :^)
This is a convenient wrapper around readlink() that hides away the details
of buffers and buffer sizes, and simply returns a String. The best part is it
doesn't rely on PATH_MAX :D

It comes in two versions, for Serenity, where we can pass non-null-terminated
strings to syscalls, and where sys$readlink() returns the total link size, and
for other systems, where we have to copy out the string, and always have to do
two syscalls.
2020-06-17 15:02:03 +02:00
Andreas Kling
d54ace5f04 LibCore: Add Core::File::real_path_for()
A slightly convenient wrapper around realpath(3).
2020-06-12 21:29:01 +02:00
Andreas Kling
a19690170f LibCore: Make Core::File::open() return a Result<NNRP<File>, String>
It was impractical to return a RefPtr<File> since that left us no way
to extract the error string. This is usually needed for the UI, so the
old static open() got basically no use.
2020-04-21 16:19:18 +02:00
Andreas Kling
0df15823b5 LibCore: Add a static Core::File::open() convenience function
This helper opens a file with a given name, mode and permissions and
returns it in a RefPtr<File>. I think this will be a bit nicer to use
than having to go through Core::File::construct() every time.
2020-03-30 12:08:25 +02:00
Andreas Kling
90fec9c732 LibCore: Add "static bool Core::File::exists(filename)" 2020-02-12 21:17:00 +01:00
Andreas Kling
67ccdbe384 LibCore: Add File::is_directory() helpers 2020-02-09 14:15:55 +01:00
Andreas Kling
d17e23bd27 LibCore: Remove leading C from filenames 2020-02-06 15:04:03 +01:00
Renamed from Libraries/LibCore/CFile.h (Browse further)