Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving file from one directory to another

Status
Not open for further replies.

tewari68

Programmer
Jan 25, 2005
87
US
Hi,
I have a mounted filesystem (debian), and have to move a file after some processing from the temporary directory to another directory.
Don't want to use system call for mv unix command.
Tried using rename C++ function but it doesn't work on mounted file system.
So I am looking for some other built in C++ function, similar to the mv command to accomplish this.
Appreciate if anybody can tell me with t his.
Thanks,
Tewari
 
Try rename(oldpath,newpath). This ANSI-compliant library function can (by Standard) move a file (but not a directory) from one directory to another.
 
You could just use a system call of the shell command mv

Amos
Computer Science
U of MO - Rolla
 
oops missed that

Amos
Computer Science
U of MO - Rolla
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top