[filesystem] Using filesystem library from Boost version 1.44 on Cygwin 1.7
Date: Fri, 27 Aug 2010 15:39:29 -0700
From: Steven Watanabe
I have been using the filesystem library from Boost version 1.43 on a Cygwin 1.7.6-1 platform without any problems. The library was built using the Cygwin version of GCC 4.3.4. The library from the 1.44 version of Boost compiles compiles o.k., but the functions that access files no longer work. This appears to be true for both versions 2 and 3 of the library. Below is a simple program that runs o.k. with the Boost version 1.43 version of the library. The program runs but can not read the file status using Boost version 1.44. This program also works fine when built using MSVC 9.0 and Boost version 1.44.
//--------------------
<snip>
int main() { <snip> std::cout << "Error code message: " << ec.message() << std::endl; return 0; }
//--------------------
This program's output on my system is shown below. The file 'foo' is written by the program and does actually exist.
For version 2:
boost::filesystem library version is v2 Checking status of file foo... Error code value: 0 Error code message: The operation completed successfully Does file exist? false
Your code doesn't appear to print this last line. In Christ, Steven Watanabe ------------------------------ You are right. I added the last line after pasting in the code. Here it is: boost_fs::file_status st = boost_fs::status(path, ec); <snip> std::cout << "Does file exist? " << boost_fs::exists(st) << std::endl; return 0; } Is there anything I can do to make this work? Thanks, Carus V. (Bud) Clarke carus.v.clarke@boeing.com ------------------------------
AMDG Clarke, Carus V wrote:
Steven Watanabe wrote:
Your code doesn't appear to print this last line.
You are right. I added the last line after pasting in the code. Here it is:
boost_fs::file_status st = boost_fs::status(path, ec); <snip> std::cout << "Does file exist? " << boost_fs::exists(st) << std::endl; return 0; }
Is there anything I can do to make this work?
It looks like stat is setting errno to ENOENT. Do you get the same behavior if the file exists before starting the program? In Christ, Steven Watanabe
participants (2)
-
Clarke, Carus V
-
Steven Watanabe