hare

The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit a564b68f20ad6888610d403760ea33e2431412d3
parent 6dcaf9c5790d8c288a50454fafc735ab119359f9
Author: Drew DeVault <sir@cmpwn.com>
Date:   Fri,  7 Jan 2022 12:47:35 +0100

os: add wrapper for fs::readlink

Signed-off-by: Drew DeVault <sir@cmpwn.com>

Diffstat:
Mos/fs.ha | 4++++
1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/os/fs.ha b/os/fs.ha @@ -60,6 +60,10 @@ export fn chown(path: str, uid: uint, gid: uint) (void | fs::error) = fs::chown( // the return value. export fn resolve(path: str) str = fs::resolve(cwd, path); +// Returns the path referred to by a symbolic link. The caller must free the +// return value. +export fn readlink(path: str) (str | fs::error) = fs::readlink(cwd, path); + // Opens a file. // // If no flags are provided, [[fs::flags::RDONLY]], [[fs::flags::NOCTTY]],