Boost logo

Boost :

From: Walter Landry (wlandry_at_[hidden])
Date: 2003-10-02 20:06:38


Beman Dawes <bdawes_at_[hidden]> wrote:
> At 06:16 AM 9/18/2003, Walter Landry wrote:
>
> >I have attached patches for a few assorted improvements to the
> >filesystem library. These patches are only to the posix side of
> >things. I wouldn't know the first thing of what to do on Windows.
>
> It may be a few days before I get a chance to look at these, but I will get
> back to you on them.

I haven't heard anything, but here is another patch. If you are
checking for whether a path exists, you should use lstat instead of
stat. Otherwise, with the library as written, you can never delete a
symlink that points to nowhere.

I've attached a patch.

Thanks,
Walter Landry
wlandry_at_[hidden]

** context diff

   --- /home/boo/{revisions}//wlandry_at_ucsd.edu--arx/boost/boost--arx/boost--arx--1.0/boost--arx--1.0--patch-14/./libs/filesystem/src/operations_posix_windows.cpp 2003-09-17 14:21:25.000000000 -0400
   +++ /home/boo/arx/arx/src/boost/./libs/filesystem/src/operations_posix_windows.cpp 2003-10-02 12:50:34.000000000 -0400
   @@ -261,7 +261,7 @@
        {
    # ifdef BOOST_POSIX
          struct stat path_stat;
   - return ::stat( ph.string().c_str(), &path_stat ) == 0;
   + return ::lstat( ph.string().c_str(), &path_stat ) == 0;
    # else
          return ::GetFileAttributesA( ph.string().c_str() ) != 0xFFFFFFFF;
    # endif


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk