Remove st_blocks hack from wxFile::Length() under Linux
This reverts commit 41f6f17d01
("return 0
(meaning the file is not seekable, as the docs now explain) instead of
4KB for the files in sysfs under Linux") as it seems to be wrong to
return a value different from what "ls -l" or "stat" return here and the
original problem was solved in a better way in the previous commit.
See #9965.
Closes #17818.
This commit is contained in:
@@ -1049,3 +1049,18 @@ void FileNameTestCase::TestShortcuts()
|
||||
}
|
||||
|
||||
#endif // __WINDOWS__
|
||||
|
||||
#ifdef __LINUX__
|
||||
|
||||
// Check that GetSize() works correctly for special files.
|
||||
TEST_CASE("wxFileName::GetSizeSpecial", "[filename][linux][special-file]")
|
||||
{
|
||||
wxULongLong size = wxFileName::GetSize("/proc/kcore");
|
||||
INFO( "size of /proc/kcore=" << size );
|
||||
CHECK( size > 0 );
|
||||
|
||||
// All files in /sys seem to have size of 4KiB currently.
|
||||
CHECK( wxFileName::GetSize("/sys/power/state") == 4096 );
|
||||
}
|
||||
|
||||
#endif // __LINUX__
|
||||
|
Reference in New Issue
Block a user