On Windows, you can use the GetVolumeInformation function. On Linux and OSX (and BSD!), you can use the statfs function.
Write filesystem-dependent code in c++
-
03-06-2022 - |
문제
How can I write filesystem-dependent code in C++? I am writing a user level library that should handle files in different ways depending on certain features in the underlying filesystem, how can I figure that out?
For example, are there any defined preprocessor directives that expose the filesystem?
해결책
다른 팁
I'm not aware of any information that the preprocessor would give you on this.
Something to keep in mind is that you might be in a situation where the OS supports multiple types of filesystems. It's not inconceivable that an application might be accessing multiple filesystems at the same time on the same box.
제휴하지 않습니다 StackOverflow