[Boost-bugs] [Boost C++ Libraries] #11947: filesystem: getting file_type from a directory_entry without causing a system call on linux

Subject: [Boost-bugs] [Boost C++ Libraries] #11947: filesystem: getting file_type from a directory_entry without causing a system call on linux
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-01-29 10:44:32


#11947: filesystem: getting file_type from a directory_entry without causing a
system call on linux
---------------------------------------+--------------------------
 Reporter: Taru Karttunen <taruti@…> | Owner: bemandawes
     Type: Patches | Status: new
Milestone: To Be Determined | Component: filesystem
  Version: Boost 1.61.0 | Severity: Optimization
 Keywords: |
---------------------------------------+--------------------------
 When iterating over a directory with directory_iterator the
 directory_entries are created with the file_type component of the
 m_symlink_status defined if the filesystem supports it on Linux due to
 BOOST_FILESYSTEM_STATUS_CACHE.

 However the directory iteration does not produce the permission component
 of the file status. Thus if using
 `somedirectoryentry.symlink_status().type()` the library performs a
 superfluous lstat system call because status_known does not succeed due to
 permissions_present not succeeding.

 This is possible to fix e.g. by adding a symlink_type method to the
 directory_entry class, a patch implementing it is linked below:

 https://github.com/taruti/filesystem/commit/835bcd3c13697cbd7fc3d8574fd07475eeada398

 ps. Is the documentation manually or automatically created and does it
 need a separate patch?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11947>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC