afero icon indicating copy to clipboard operation
afero copied to clipboard

MemMapFs paths are reported as being on the actual system OS

Open maxiride opened this issue 2 years ago • 1 comments

I just discovered afero and tried the in memory filesystem, upon playing with these two lines of code below I noticed that the reported path of the temporary files is on my local machine:

C:\Users\federico.d\AppData\Local\Temp\108673950

(property afero.File.fileData.name)

However, the file doesn't actually exist on the OS.

memFS := afero.NewMemMapFs()
temp1, _ := afero.TempFile(memFS, "", "")

This isn't at all an issue, I suppose, but it raised concerns on me when I was about to execute a RemoveAll on a path.

Is this the expected behaviour and if so why mimicking real OS paths?

maxiride avatar Mar 25 '22 09:03 maxiride

No, it is not the expected behavior and is making it hard for me to do unit tests using the InMemory storage

e200 avatar Jun 07 '23 12:06 e200