Comments (6)
from jimfs.
In the end, I created the fs like this:
Jimfs.newFileSystem(
Configuration.builder(PathType.unix())
.setRoots("/")
.setWorkingDirectory("/")
.setAttributeViews("basic")
.setSupportedFeatures(Feature.SECURE_DIRECTORY_STREAM, Feature.FILE_CHANNEL)
.build())
To get a working directory in the root directory. Still don't know what a working directory is... ;-)
from jimfs.
The working directory is the directory that relative paths are resolved against. For the default file system, this is something that's set based on how the JVM is launched.
I agree that the default of /work
for the working directory for Jimfs is weird. I didn't, though, want to make /
the working directory by default because it would be pretty unusual in a real file system to have the root as your working directory. It may be that it wouldn't be a problem in practice and I was just being paranoid, though. My other thought was that most use cases for Jimfs wouldn't care about whether or not the directory existed, nor what exactly the working directory path was.
from jimfs.
I see in the code that is created in Configuration.unix() as the working directory. Now my question is: what is a working directory, and can I delete it and have a "clean", empty fs?
from jimfs.
Hi @cgdecker
Is @proofrock's code above still the best way to create an empty file system?
from jimfs.
We were trying to use Jimfs to test code, which writes into S3 in production via the https://github.com/awslabs/aws-java-nio-spi-for-s3 file system service provider.
In that use case, having /
as the current directory would make more sense too.
from jimfs.
Related Issues (20)
- JimfsFileChannel the method read why need synchronized
- JimfsPath.resolve can accept Path instance other than JimfsPath HOT 2
- Check for problems with ByteBuffer covariant return types when building with JDK 9+ HOT 3
- Jimfs release 1.2 HOT 2
- setPermissions and setTimes on symlinks don't behave as on Unix/macOS
- Detect resource leaks
- Allow to write to PathURLConnection HOT 2
- Incorrect block allocation in transferFrom implementation HOT 3
- Sensless feedback loop HOT 1
- FileStore.getBlockSize() should return the configuration block size HOT 1
- How can I create a java RandomAccessFile on the jimfs filesystem? HOT 1
- State of support for JIMFS HOT 4
- Integration of jimfs into OSS-Fuzz HOT 3
- Files.list does not work with jimfs paths (NoSuchFileException) HOT 4
- Files#readAttributes throws NullPointerException for non existent attribute view.
- Drop Java 7 compatibility HOT 2
- Vulnerability reporting inconsistency for CVE-2020-8908 HOT 4
- Files.newOutputStream throws if file is a symlink to a non-existing target. HOT 2
- Jimfs support for JUnit 5 `TempDirFactory` HOT 4
- java.nio.file.WatchService is missing events sometimes 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 jimfs.