Kernel: Add File::is_regular_file()

This makes it easy and expressive to check if a File is a regular file.
This commit is contained in:
Andreas Kling 2022-11-27 23:50:28 +01:00
parent c8ff2184bd
commit 4dd148f07c
Notes: sideshowbarker 2024-07-17 06:20:50 +09:00
3 changed files with 9 additions and 0 deletions

View file

@ -120,4 +120,9 @@ ErrorOr<void> InodeFile::chmod(Credentials const& credentials, OpenFileDescripti
return VirtualFileSystem::the().chmod(credentials, *description.custody(), mode);
}
bool InodeFile::is_regular_file() const
{
return inode().metadata().is_regular_file();
}
}