Giter Site home page Giter Site logo

If a folder doesn't have read/write access, if (!(permission & fs::perms::owner_read) == fs::perms::no_perms) will always return success. about filesystem HOT 1 CLOSED

Rahool24 avatar Rahool24 commented on July 27, 2024
If a folder doesn't have read/write access, if (!(permission & fs::perms::owner_read) == fs::perms::no_perms) will always return success.

from filesystem.

Comments (1)

Lastique avatar Lastique commented on July 27, 2024
  1. if (!(permission & fs::perms::owner_read) == fs::perms::no_perms) is likely incorrect. operator! has higher precedence than operator==, so the condition reads as if ( (!(permission & fs::perms::owner_read)) == fs::perms::no_perms ), i.e. the result of permission & fs::perms::owner_read is converted to bool, then an inverse of it is converted to fs::perms and compared to fs::perms::no_perms. This makes no sense at all. I think, you wanted to say if ((permission & fs::perms::owner_read) != fs::perms::no_perms) instead.
  2. On Windows, read permission is always indicated as present because Windows doesn't really support POSIX permissions. Basically, if a file is marked with the "read-only" attribute, Boost.Filesystem will indicate the file as readable. If it is not marked, it will indicate it as both readable and writable.
  3. Boost.Filesystem does not support or interpret ACLs, if that's how you define the file as "readable". There are no plans to support ACLs, and such support would not translate to POSIX-style permissions anyway.

from filesystem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.