mv'ing files from a C program

matt robinson yakker at ucrmath.ucr.edu
Mon Nov 19 18:37:12 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?
->

You might want to try out using rename(1).  Note that I believe this only
works if you are within the same partition, and it may not follow all
symbolic links.  There's a barrage of error returns from a rename(), so
take a look at what is in the manual.  (Sun has a massive list of return
codes from this call.)

Hope this helps.

--Matt

______________________________________________________________________________
Matt D. Robinson                                 "...if I only had a brain..."
Systems Programming Group, UC Riverside     -- The Scarecrow, The Wizard Of Oz
Internet : yakker at ucrmath.ucr.edu       UUCP : ..!ucsd!ucrmath!{yakker,source}



More information about the Comp.unix.questions mailing list