2 ms·
Looks like they're just including posix semantics. But it is weird and I don't see the point. The only platforms likely to offer this interface already offer th
by tedunangst 12y ago
Looks like they're just including posix semantics. But it is weird and I don't see the point. The only platforms likely to offer this interface already offer the posix interface. If I'm on a posix system, I can just call stat(). Calling filesystem::is_socket() would only make my code less portable by restricting it to the latest c++ runtimes.
- roel_v 12y ago"Looks like they're just including posix semantics." No they're not. Filesystem is an abstraction of paths, directories, file status and the like. For example, posix doesn't have a notion of 'platform native display format' (i.e. slash as directory separator on Windows), so without a library like filesystem you have to write your own abstraction layer for that sort of stuff.
- tedunangst 12y agoThe particular set of file types recognized (character device? block device?) are clearly ripped straight from posix. It even says implementations should try to match posix. But ok, yes, this is more than just posix. This is posix plus directory separator character. FWIW, I've found automagic backslash handling more trouble than its worth. Everything seems to just work until it doesn't. A pathname is inevitably "pretty printed" on Windows which then makes its way as input to a unix system where it's interpreted incorrectly. Of course, back then we called this boost.