Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 362747 - [TCF][File System] Add a method to move a file or folder.
Summary: [TCF][File System] Add a method to move a file or folder.
Status: RESOLVED INVALID
Alias: None
Product: TCF
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Eugene Tarassov CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-02 22:57 EDT by William Chen CLA
Modified: 2011-11-03 04:35 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William Chen CLA 2011-11-02 22:57:29 EDT
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
Comment 1 Uwe Stieber CLA 2011-11-03 02:59:37 EDT
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.
Comment 2 William Chen CLA 2011-11-03 03:43:42 EDT
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.
Comment 3 William Chen CLA 2011-11-03 04:21:28 EDT
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
Comment 4 Uwe Stieber CLA 2011-11-03 04:35:35 EDT
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 :).