Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This is easily the most helpful website I've ever used, and this is the best forum with the quickest response time bar none...."

Geography

Where in the world do Tek-Tips members come from?

Moving file from one directory to another

tewari68 (Programmer)
25 May 05 17:06
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
ArkM (IS/IT--Management)
26 May 05 0:33
Try rename(oldpath,newpath). This ANSI-compliant library function can (by Standard) move a file (but not a directory) from one directory to another.
jstreich (Programmer)
26 May 05 10:11
If it is after some processing, then why don't you just write the out put of processing using a ofstream to the destination, then remove the original?

[plug=shameless]
http://game-master.us/phpx-3.4.0/
[/plug]

Adkron (Programmer)
6 Jun 05 12:30
You could just use a system call of the shell command mv

Amos
Computer Science
U of MO - Rolla

cpjust (Programmer)
6 Jun 05 14:27
I think that's why he said:

Quote:


Don't want to use system call for mv unix command.
Adkron (Programmer)
7 Jun 05 12:11
oops missed that

Amos
Computer Science
U of MO - Rolla

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close