trussed-dev / trussed

Modern Cryptographic Firmware
https://trussed.dev
Apache License 2.0
405 stars 26 forks source link

Add rename syscall to FilesystemClient #142

Closed robin-nitrokey closed 9 months ago

robin-nitrokey commented 9 months ago

This patch adds a rename syscall to the FilesystemClient that allows applications to move a file within the same storage location and within the client namespace.

sosthene-nitrokey commented 9 months ago

Would we not want to make it possible to rename across filesystems ?

It's a bit more involved but it's already implemented in trussed-staging as an internal need of the staging backend: https://github.com/Nitrokey/trussed-staging/blob/c6aa6bdd65f04eb746a2d65725ba2d01c27ae1f7/src/streaming/store.rs#L99

robin-nitrokey commented 9 months ago

To me it makes sense to have rename as a cheap and atomic operation that is only possible on the same filesystem. Adding the method you linked would be nice, but I’d rather call it copy to reflect the actual cost.