FileUtil: Don't try to retrieve size for FIFO pipe

This commit is contained in:
MattKC 2023-09-24 19:36:15 -07:00 committed by GitHub
parent f8445782bf
commit e16753472c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -452,7 +452,7 @@ FSTEntry ScanDirectoryTree(std::string directory, bool recursive)
auto dirent_to_fstent = [&](const fs::directory_entry& entry) {
return FSTEntry{
.isDirectory = entry.is_directory(),
.size = entry.is_directory() ? 0 : entry.file_size(),
.size = entry.is_directory() || entry.is_fifo() ? 0 : entry.file_size(),
.physicalName = path_to_physical_name(entry.path()),
.virtualName = PathToString(entry.path().filename()),
};