mirror of
https://github.com/NixOS/nix.git
synced 2025-11-12 05:26:02 +01:00
SourceAccessor: Change the main interface from lstat() to maybeLstat()
This commit is contained in:
parent
8ffd1695ce
commit
cdb27c1519
9 changed files with 22 additions and 20 deletions
|
|
@ -20,12 +20,12 @@ struct MemoryInputAccessorImpl : MemoryInputAccessor
|
|||
return i != files.end();
|
||||
}
|
||||
|
||||
Stat lstat(const CanonPath & path) override
|
||||
std::optional<Stat> maybeLstat(const CanonPath & path) override
|
||||
{
|
||||
auto i = files.find(path);
|
||||
if (i != files.end())
|
||||
return Stat { .type = tRegular, .isExecutable = false };
|
||||
throw Error("file '%s' does not exist", path);
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
DirEntries readDirectory(const CanonPath & path) override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue