andrewosh / hyperdrive-fuse

A FUSE flesystem for Hyperdrive
MIT License
12 stars 6 forks source link

Add rename function, only supports files. #9

Closed 8000ff closed 5 months ago

andrewosh commented 4 years ago

@8000ff Really appreciate your doing this! A few high-level comments:

The guts of the rename function here look right to me (I'll leave a few comments about error handling, but the big picture is right). Since renaming is useful in Hyperdrive generally, I'd move the rename logic over there, and have hyperdrive-fuse's rename call out to that (so that rename looks a lot like truncate).

The tests you wrote are great to have. If you don't mind, one more test that shows that renaming a directory fails with an EISDIR (as you mentioned in the Discord) would be ideal.

Let me know if you're up for doing those things. If not, I'd be happy to go ahead and do it for you too. Thanks again :)

andrewosh commented 4 years ago

Just one more follow-up: if this code's moved to Hyperdrive, then the error handling will have to be slightly different, but I can help out with that in the Hyperdrive PR.