|
Boost Users : |
From: Dominique Devienne (ddevienne_at_[hidden])
Date: 2020-05-06 15:45:41
Hi. I'm not having any luck with finding out whether a folder is writable
or not,
on Windows. Is Boost.Filesystem (1.64) supposed to work on Windows for
permissions?
Especially in "special" folders like those in "C:\Program Files"?
C:\Program Files\Vendor\App>echo foo > bar
Access is denied.
But Boost.Filesystem reports permissions as rw-rw-rw-, when printing
them using the BFS-equivalent to the example available on CppReference
https://en.cppreference.com/w/cpp/filesystem/perms
Despite obviously the folder not being writable, w/o being an administrator.
I'm naively using simple code like below:
```
fs::path path(name);
fs::file_status stat = fs::status(path);
fs::perms p = stat.permissions();
demo_perms(p);
```
Am I missing something obvious? Thanks, --DD
PS: I worked around the above, actually trying to create a file,
but that has corner cases too, and I'd much prefer a reliable and
cross-platform
.permissions() from Boost. Smoothing-over platform differences is one
"raison d'etre"
from Boost after all, no?
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net