mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 09:19:03 +00:00
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.
This commit is contained in:
committed by
Andreas Kling
parent
47d83800e1
commit
d89843f96f
@@ -47,6 +47,7 @@ public:
|
||||
|
||||
static bool exists(const String& filename);
|
||||
static String real_path_for(const String& filename);
|
||||
static String read_link(const StringView& link_path);
|
||||
|
||||
virtual bool open(IODevice::OpenMode) override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user