Comments (8)
(fs/file "a" "path" "segment")
from fs.
💣 boom.
from fs.
Lets 🐛 @amalloy all right now 👯 💃 👯
from fs.
fs/file is not just doing a join. It's also doing cwd operations. I guess I can use io/file.
from fs.
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.
No, that's incorrect.
cavm.cgdata=> (fs/file "one")
#<File /inside/home/craft/cavm/one>
cavm.cgdata=> (io/file "one")
#<File one>
from fs.
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.
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)
- touch doesn't set the provided time if it created the file
- Release? HOT 4
- clear-dir HOT 1
- When would I see include-java-7-fns? HOT 2
- New Maintainer Needed HOT 31
- Support for wildcard in the middle of the path
- Globbing: support for recursive directory matching `(**)`
- How do I import this lib HOT 1
- When I require this lib as fs,some function doesn't work at all HOT 1
- Utility to join components (OS-aware) HOT 2
- Link to API Docs no longer works HOT 1
- Security vulnerability in dependent library
- Will someone take over this project? HOT 2
- Method java.io.File toUrl is deprecated HOT 1
- copy-dir-into HOT 3
- [Suggestion] Add function to fix paths for different OS HOT 2
- Tests don't run cleanly on Windows HOT 3
- Thank you for this library.
- file function broken on windows
- No way to set .deleteOnExit() on things created by the temp-..thing.. fns. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fs.