mv'ing files from a C program

Gary Weimer weimer at ssd.kodak.com
Fri Nov 16 03:06:29 AEST 1990


In article <22 at mixcom.UUCP> ggvvgg at mixcom.UUCP (Dave Fenske) writes:
>Is there an easy way to do an 'mv' from a C program?
>
>I just want to be able to move a recently read file into another directory,
>and wish to avoid having to write it there.  Using the 'system' call is
>not deemed wiable for this application.
>

You could simulate the mv command using link(2) and unlink(2). First create
a second link in the new directory. If no error, remove first link (unlink).



More information about the Comp.unix.questions mailing list