-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Empty filesystem contains a "work" dir (that shouldn't be there) #74
Comments
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? |
In the end, I created the fs like this:
To get a working directory in the root directory. Still don't know what a working directory is... ;-) |
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 |
Thanks Colin! My use case involves creating an empty file system, and populating it with virtual files to expose via FTP; the FTP library I use makes it convenient to "attach" a java-style Filesystem, and yours was a perfect fit (and still is). Only I found that a new filesystem wasn't empty, that's all! :-) Once it's known, it's easy enough to avoid this; I can only suggest to document it somewhere.
Thanks again,
Germano
|
Hi @cgdecker Is @proofrock's code above still the best way to create an empty file system? |
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 |
Hi,
first of all, thanks for this library. I'm trying to use it, but the following code (in Kotlin)...
val fs = Jimfs.newFileSystem(Configuration.unix())
val rootDir = fs.getPath("/")
Files.newDirectoryStream(rootDir).forEach { println(it) }
...prints...
/work
Am I doing something wrong? As far as I can understand, that dir shouldn't be there.
Thanks again for your work!
The text was updated successfully, but these errors were encountered: