RenameAsync is used to change the file name.
Task RenameAsync(string currentName, string newName, Etag etag = null);
||The name of the file that you want to change
||The new name of a file
||The current file etag used for concurrency checks (
null skips check)
||A task that represents the asynchronous rename operation
Note that a file move operation is basically the rename too (directories are just a virtual concept). In order to move
intro.avi file from
/movies folder to
/movies/examples, we need to use the following code:
Rename on the server side
If the file rename is requested, RavenFS needs to update collection of usages of this file's pages. In order to make RavenFS resistant to restarts in the middle of the rename operation, use a a periodic task, which ensures that all requested renames will be finished after the restart.