mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 20:05:07 +00:00
Kernel: Add FileDescription::try_serialize_absolute_path()
Unlike FileDescription::absolute_path(), this knows that failures can happen and will propagate them to the caller.
This commit is contained in:
parent
a27c6f5226
commit
cae20d2aa9
2 changed files with 9 additions and 0 deletions
|
@ -344,6 +344,14 @@ KResult FileDescription::close()
|
|||
return m_file->close();
|
||||
}
|
||||
|
||||
KResultOr<NonnullOwnPtr<KString>> FileDescription::try_serialize_absolute_path()
|
||||
{
|
||||
if (m_custody)
|
||||
return m_custody->try_serialize_absolute_path();
|
||||
// FIXME: Don't go through a String here!
|
||||
return KString::try_create(m_file->absolute_path(*this));
|
||||
}
|
||||
|
||||
String FileDescription::absolute_path() const
|
||||
{
|
||||
if (m_custody)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue