logoalt Hacker News

socalgal2yesterday at 8:26 PM4 repliesview on HN

What's special about node.js here? Does golang, C#, python, ruby, java, etc... have a virtual file system?

I get it, I've implemented things for tests, I'm just wondering if this shouldn't be solved at an OS level.

--- update

Let's put this another way, my code does effectively, child_process.spawn('something-that-reads-and-write-a-file')

now I'm back to the same issue. To test I need a virtual file system. Node providing one won't help.


Replies

sauercrowdyesterday at 8:36 PM

Go actually does https://pkg.go.dev/embed

I do think it's more painful to distribute files when you're a distributed as a single binary vs scripts, since the latter has to figure out bundling of files anyway.

But still - it does exist

show 2 replies
paradox460yesterday at 10:52 PM

In the past, I've implemented this in Ruby and elixir on Linux systems using a ramdisk.

Retr0idtoday at 4:32 AM

Python doesn't have a virtual filesystem in general but it is possible to shim the import mechanism.

antonvsyesterday at 11:10 PM

Java, Haskell, Rust, and several other languages do have solutions for this. Here’s one for Rust: https://docs.rs/vfs/latest/vfs/