Git Product home page Git Product logo

Comments (5)

humphd avatar humphd commented on July 22, 2024 1

Hey @tinchoz49, this is a bug, thanks for filing. We currently assume flags are in string form ('w+' is closest to what you'd want), and don't yet support passing flags as a bitwise number. We should.

Fixing this would involve making our code do what node does:

A simple fix would be to alter our O_FLAGS object to use numeric keys vs. strings, and convert strings to numbers like node does.

from filer.

humphd avatar humphd commented on July 22, 2024 1

@rscotchmer great, here are some more thoughts.

We currently use strings for flags, and we should switch to using numbers. If a string is passed to us, we should convert it into a number. See the code I linked to above from node, which does what we want.

Next, we do a bunch of checks all over like this: https://github.com/filerjs/filer/blob/master/src/filesystem/implementation.js#L622. Instead of doing this, we'd want to convert that to use the flags number, and bitwise & (and) it with the constant we want to check against. The constants we want are defined in https://github.com/filerjs/filer/blob/master/src/constants.js#L88.

We could start by converting the code in the first comment above into a test we add to the fs.open.spec.js test file, and add more as we go. I have no doubt you'll find other bugs while fixing this, since we probably don't do the right thing in all cases with flags vs. what node does.

Let me know what questions you have, or further help I can give. I'm happy to guide you as you deem necessary.

from filer.

humphd avatar humphd commented on July 22, 2024

@rscotchmer not sure what you're looking to do for your 0.3 bugs, but this one might be interesting to you. I could mentor you through it, if you have interest. No pressure if you have other things you want to try next.

from filer.

CDNRae avatar CDNRae commented on July 22, 2024

@humphd I'd love to work on this! Thanks for notifying me!

from filer.

tinchoz49 avatar tinchoz49 commented on July 22, 2024

Hey everyone, thanks to start working on this!

from filer.

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.