hugelgupf / p9

Idiomatic Go 9P2000.L client and server, extracted from gVisor for general use
Apache License 2.0
90 stars 19 forks source link

Implement UnlinkAt in localfs #87

Closed edouardklein closed 11 months ago

edouardklein commented 1 year ago

Fix #86

This is my attempt at UnlinkAt as discussed in #86 .

I also added ATime in the ignored but valid fields of SetAttr, as without it, touch can't create a file over 9P.

I hope the tests are OK. I added TestReadOnlyFS to localfs' test suite, and created a TestReadWriteFS to try out the new UnlinkAt implementation.

Please let me know if you need me to change anything.

I also tested the changes from the client side in another piece of software I'm writing, and p9ufs behaves the same way as if the changes were done directly by through the kernel file API.

djdv commented 1 year ago

Unrelated to the scope of this PR: While I was looking at this code I was wondering if filepath.FromSlash should be used in places that pass to os file operations. (Platforms like Windows will accept either slash in a name, but \ is its canonical os.PathSeparator.)

edouardklein commented 1 year ago

@hugelgupf @djdv , sorry to be a bother, but do you think this could get merged ? I'd be more comfortable using the official repo rather than my fork.

If there's something missing or subpar please tell me and I'll do my best to correct it.

Cheers,

Edouard.