Community
Participate
Working Groups
Build Identifier: The current file system service (IFileSystem) does not provide a method to move a file or folder. Though it is possible to move a file or a folder by combining other methods including copy, remove, mkdir and rmdir, it is not efficient, since most of the cases, moving files or folders only involves changing file indexes. Please add a method "move" to the file system service to directly move a file or folder from one place to another. Reproducible: Always
The function to expose is IMO "int rename(const char *oldpath, const char *newpath)". So I suggest that we add a "rename" function to the file system service interface, instead of "move". Given that we probably like to implement some parameters to "rename", in example to implement a behavior like "mv -f", a third argument to "rename", like "params" or similar, should be considered. Eugene: If we want to add a method to the file system service, we do have to provide a IFileSystemV1 interface, is this correct? There are probably one or two other methods to discuss if adding a new version of the file system interface.
Hi Eugene & Uwe, I did see a method named "rename" in the interface IFileSystem. Its signature reads: IToken rename(String old_path, String new_path, DoneRename done); If this is the method to do both move and rename, then this bug should be invalid and closed.
Hi Uwe & Eugene, Just now I tried to use rename to move a file and it worked! It seems that this method "rename" is the same method to move a file/folder besides renaming. Eugene, can you confirm that this method is meant to do both renaming and moving? If that is the case, then I need to close this bug as a invalid one. -William
William, "rename" is the one to use. I should have checked the IFileSystem interface myself too. The unix "mv" utility is using the "rename" C API. For details on the C side, please check the Unix man page "rename (2)" on your Linux box :).