Discussion:
[Mingw-w64-public] Various std::experimental::filesystem errata
Riot
2017-07-03 17:04:29 UTC
Permalink
I came across two fairly major inconsistencies with
std::experimental::filesystem support today.

One is that std::experimental::filesystem::temp_directory_path returns
empty every time, with "unknown error."

The other is that std::experimental::filesystem::remove silently fails to
delete anything.


Regards,
Riot
niXman
2017-07-03 20:19:36 UTC
Permalink
Post by Riot
I came across two fairly major inconsistencies with
std::experimental::filesystem support today.
One is that std::experimental::filesystem::temp_directory_path returns
empty every time, with "unknown error."
The other is that std::experimental::filesystem::remove silently fails to
delete anything.
Hi,

Can you provide testcases, please?
--
Regards, niXman
___________________________________________________
Dual-target(32 & 64-bit) MinGW-W64 compilers for 32 and 64-bit Windows:
https://sf.net/p/mingw-w64/
Riot
2017-07-03 21:25:51 UTC
Permalink
Sure, but they're embarassingly trivial, as my email suggests.

// build with g++ test_temp_path.cpp -lstdc++fs
#include <iostream>
#include <experimental/filesystem>

auto main()->int {
std::cout << "Temp dir: \"" <<
std::experimental::filesystem::temp_directory_path() << "\"" << std::endl;
return EXIT_SUCCESS;
}


Temp dir: "terminate called after throwing an instance of
'std::experimental::filesystem::v1::__cxx11::filesystem_error'
what(): filesystem error: temp_directory_path: Unknown error


Similarly:

// build with g++ test_remove.cpp -lstdc++fs
#include <experimental/filesystem>

auto main()->int {
std::experimental::filesystem::remove("my_file.txt");
return EXIT_SUCCESS;
}


terminate called after throwing an instance of
'std::experimental::filesystem::v
1::__cxx11::filesystem_error'
what(): filesystem error: cannot remove: Unknown error [my_file.txt]



Regards,
Riot
Post by niXman
Post by Riot
I came across two fairly major inconsistencies with
std::experimental::filesystem support today.
One is that std::experimental::filesystem::temp_directory_path returns
empty every time, with "unknown error."
The other is that std::experimental::filesystem::remove silently fails to
delete anything.
Hi,
Can you provide testcases, please?
--
Regards, niXman
___________________________________________________
https://sf.net/p/mingw-w64/
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
Ruben Van Boxem
2017-07-04 06:22:42 UTC
Permalink
Op 3 jul. 2017 11:27 p.m. schreef "Riot" <***@gmail.com>:

Sure, but they're embarassingly trivial, as my email suggests.

// build with g++ test_temp_path.cpp -lstdc++fs
#include <iostream>
#include <experimental/filesystem>

auto main()->int {
std::cout << "Temp dir: \"" <<
std::experimental::filesystem::temp_directory_path() << "\"" << std::endl;
return EXIT_SUCCESS;
}


Temp dir: "terminate called after throwing an instance of
'std::experimental::filesystem::v1::__cxx11::filesystem_error'
what(): filesystem error: temp_directory_path: Unknown error


Similarly:

// build with g++ test_remove.cpp -lstdc++fs
#include <experimental/filesystem>

auto main()->int {
std::experimental::filesystem::remove("my_file.txt");
return EXIT_SUCCESS;
}


terminate called after throwing an instance of
'std::experimental::filesystem::v
1::__cxx11::filesystem_error'
what(): filesystem error: cannot remove: Unknown error [my_file.txt]



Regards,
Riot


What GCC version is this? Where does the filesystem code come from (patch,
upstream, ...)? It might be incomplete and this error may just be the
library telling you it's not implemented.

Ruben
Post by niXman
Post by Riot
I came across two fairly major inconsistencies with
std::experimental::filesystem support today.
One is that std::experimental::filesystem::temp_directory_path returns
empty every time, with "unknown error."
The other is that std::experimental::filesystem::remove silently fails to
delete anything.
Hi,
Can you provide testcases, please?
--
Regards, niXman
___________________________________________________
https://sf.net/p/mingw-w64/
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
niXman
2017-07-04 06:30:42 UTC
Permalink
Ruben Van Boxem 2017-07-04 09:22:

Hi,
Post by Ruben Van Boxem
What GCC version is this?
7.1
Post by Ruben Van Boxem
Where does the filesystem code come from (patch,
upstream, ...)? It might be incomplete and this error may just be the
library telling you it's not implemented.
https://github.com/niXman/mingw-builds/blob/master/patches/gcc/gcc-7-filesystem.patch
--
Regards, niXman
___________________________________________________
Dual-target(32 & 64-bit) MinGW-W64 compilers for 32 and 64-bit Windows:
https://sf.net/p/mingw-w64/
niXman
2017-07-04 06:31:28 UTC
Permalink
Post by Riot
Sure, but they're embarassingly trivial, as my email suggests.
// build with g++ test_temp_path.cpp -lstdc++fs
#include <iostream>
#include <experimental/filesystem>
auto main()->int {
std::cout << "Temp dir: \"" <<
std::experimental::filesystem::temp_directory_path() << "\"" << std::endl;
return EXIT_SUCCESS;
}
Temp dir: "terminate called after throwing an instance of
'std::experimental::filesystem::v1::__cxx11::filesystem_error'
what(): filesystem error: temp_directory_path: Unknown error
// build with g++ test_remove.cpp -lstdc++fs
#include <experimental/filesystem>
auto main()->int {
std::experimental::filesystem::remove("my_file.txt");
return EXIT_SUCCESS;
}
terminate called after throwing an instance of
'std::experimental::filesystem::v
1::__cxx11::filesystem_error'
what(): filesystem error: cannot remove: Unknown error [my_file.txt]
Thanks.
I'll fix it.
--
Regards, niXman
___________________________________________________
Dual-target(32 & 64-bit) MinGW-W64 compilers for 32 and 64-bit Windows:
https://sf.net/p/mingw-w64/
Loading...