Giter VIP home page Giter VIP logo

Comments (8)

Raynes avatar Raynes commented on September 3, 2024
(fs/file "a" "path" "segment")

from fs.

bitemyapp avatar bitemyapp commented on September 3, 2024

💣 boom.

from fs.

bitemyapp avatar bitemyapp commented on September 3, 2024

Lets 🐛 @amalloy all right now 👯 💃 👯

from fs.

acthp avatar acthp commented on September 3, 2024

fs/file is not just doing a join. It's also doing cwd operations. I guess I can use io/file.

from fs.

Raynes avatar Raynes commented on September 3, 2024

Why does that matter? It'll have the same effect as io/file if cwd hasn't changed.

On Wed, Sep 18, 2013 at 1:16 PM, acthp [email protected] wrote:

fs/file is not just doing a join. It's also doing cwd operations. I guess I can use io/file.

Reply to this email directly or view it on GitHub:
#59 (comment)

from fs.

acthp avatar acthp commented on September 3, 2024

No, that's incorrect.

cavm.cgdata=> (fs/file "one")
#<File /inside/home/craft/cavm/one>
cavm.cgdata=> (io/file "one")
#<File one>

from fs.

Raynes avatar Raynes commented on September 3, 2024

All it did was make the path absolute to the current working directory which is what would happen later when you need to actually do an operation or something, but fair enough. In any case, io/file and fs/file are the things one is meant to use to do what you want to do.

As for the separator bit, if it isn't exposed I'd take a pull request to add it.

from fs.

acthp avatar acthp commented on September 3, 2024

It matters when working with abstract paths, for example when dealing with files that contain references to other files. I'm doing transforms on such files, not actually reading the files they point to. So if there's a relative reference like "../over/there", and it gets changed to an absolute reference on the filesystem, the file is now broken.

It's important to be able to normalize paths while doing this, however normalize-path also converts them to absolute references. More worrying, it looks like the underlying java call .getCanonicalFile also does this. I can work around it by prepending root, then removing it. Kinda clumsy.

from fs.

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.