mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
LibCore: Implement chdir on Windows
This commit adds a wrapper around chdir in LibCore. Co-authored-by: Andrew Kaster <andrew@ladybird.org>
This commit is contained in:
parent
0de3a95433
commit
6c8623320f
Notes:
github-actions[bot]
2025-06-06 04:02:02 +00:00
Author: https://github.com/R-Goc
Commit: 6c8623320f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4927
Reviewed-by: https://github.com/ADKaster ✅
1 changed files with 11 additions and 0 deletions
|
@ -126,6 +126,17 @@ ErrorOr<ByteString> getcwd()
|
||||||
return string_cwd;
|
return string_cwd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ErrorOr<void> chdir(StringView path)
|
||||||
|
{
|
||||||
|
if (path.is_null())
|
||||||
|
return Error::from_errno(EFAULT);
|
||||||
|
|
||||||
|
ByteString path_string = path;
|
||||||
|
if (::_chdir(path_string.characters()) < 0)
|
||||||
|
return Error::from_syscall("chdir"sv, errno);
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
ErrorOr<struct stat> stat(StringView path)
|
ErrorOr<struct stat> stat(StringView path)
|
||||||
{
|
{
|
||||||
if (path.is_null())
|
if (path.is_null())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue