Any API to Rename a file with the new Drive.

Login to reply to this topic.
Wed, 2005-09-28 12:11
Joined: 2004-10-01
Forum posts: 35
Hi All,
I want to rename a file, present in c drive. The new name is containing the different drive name.

Lets say the file is present at C:\\test.xyz, now i want to rename it to F:\\my.xyz.

Is there any API to do the same??
RFs and RFile's Rename() function can not change the drive.

Please help me out

Thanks
Pinky

Wed, 2005-09-28 12:15
Joined: 2004-07-28
Forum posts: 1379
Re: Any API to Rename a file with the new Drive.
Try CFileMan::Move();

Which is the same thing as rename.

didster

Thu, 2005-09-29 01:40
Joined: 2004-10-01
Forum posts: 35
Re: Any API to Rename a file with the new Drive.
Thanks a lot didster.


~Pinky
Fri, 2008-06-06 05:41
Joined: 2008-05-21
Forum posts: 15
Re: Any API to Rename a file with the new Drive.

try this Dude........

_LIT(KFilePathOldRename,"\\System\\Test.txt");
_LIT(KFilePathNewRename,"\\System\\Test123.txt");

TBool CLFileAll::Rename(const TDesC &anOldName,const TDesC &aNewName)
{
RFs iFs;
iFs.Connect();

TInt iErr=iFs.Rename(anOldName,aNewName);
iFs.Close();
if(iErr==KErrNone)
return ETrue;
else
return EFalse;
}

works fir me, hope it works for you too.

Gud Luck.

  • Login to reply to this topic.