Tobias Langner
Tobias Langner

Reputation: 10828

How to detect file system size limitations of individual files

is there a way to detect the file system size limitations of individual files (e.g. 4gb on fat 32)?

It must work on Windows OS, but better would be a portable solution. Detecting the file system type could be a work around, but I don't know how you can do that either.

Can anybody help me out here?

Thank you in advance Tobias

Upvotes: 5

Views: 399

Answers (2)

Pontus Gagge
Pontus Gagge

Reputation: 17268

You can obtain the total capacity limitations through boost::space(), or directly use POSIX fstatvs().

As for limitations on the size of individual files... the only portable answer that springs to mind is ugly brute force try-to-create-larger-and-larger-files-until-failure, expensive as it is (and impossible if capacity is already limited).

Upvotes: 0

Anders
Anders

Reputation: 101746

You can detect the filesystem type on Windows with GetVolumeInformation

Upvotes: 3

Related Questions