Code Monkey home page Code Monkey logo

Comments (6)

proofrock avatar proofrock commented on May 19, 2024 3

from jimfs.

proofrock avatar proofrock commented on May 19, 2024 1

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.

cgdecker avatar cgdecker commented on May 19, 2024 1

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.

proofrock avatar proofrock commented on May 19, 2024

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.

seanf avatar seanf commented on May 19, 2024

Hi @cgdecker

Is @proofrock's code above still the best way to create an empty file system?

from jimfs.

onetom avatar onetom commented on May 19, 2024

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)

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.