robin@sabre.austin.ibm.com (Robin D. Wilson/1000000) (05/31/90)
I have need of a link() system call. I am using lattice v. 5.05 and cannot seem to get the rename() system call to do what I want. According to the lattice manual, the rename(old,new) call will rename old to new. Unfortunately, it will not remove new, if it exists, and it will not allow you to specify a path to "new". I have tried to get around this by writing a move() function that allows me to move(old_path, new_path) by just chdir(new_path - file_name), and the chdir(start_dir). I seem to run into a pesky I/O Error: when I do this tho'. If there was a link() equivalent (that doesn't care if the new_file exists and allows full path descriptions for both the old and the new files) I would just write my own rename() function. Can anybody help?? Thanks in advance. BTW, I haven't bought the RKM, so if it's in there, could you just provide a usage description, and which LIB I need to include. +-----------------------------------------------------------------------------+ |The views expressed herein, are the sole responsibility of the typist at hand| +-----------------------------------------------------------------------------+ |UUCP: cs.utexas.edu!romp!ibmchs!auschs!sabre.austin.ibm.com!robin | |USNail: 701 Canyon Bend Dr. | | Pflugerville, TX 78660 | | Home: (512)251-6889 Work: (512)823-4526 | +-----------------------------------------------------------------------------+
cmcmanis@stpeter.Eng.Sun.COM (Chuck McManis) (06/01/90)
In article <2474@awdprime.UUCP> robin@sabre.austin.ibm.com (Robin D. Wilson/1000000) writes: >According to the lattice manual, the rename(old,new) call will rename old >to new. Unfortunately, it will not remove new, if it exists, and it will >not allow you to specify a path to "new". You are doing the rename on the same Volume yes? If you rename from Foo:A to Foo:B then A should be removed. If you rename from Foo:A to Bar:B then what you get is a copy of A to B, and A is not deleted. You could try Execute("rename A as B", 0, 0); paying attention to the problems that Execute entails when you are not running from a CLI and need to know the result of the operation. -- --Chuck McManis Sun Microsystems uucp: {anywhere}!sun!cmcmanis BIX: <none> Internet: cmcmanis@Eng.Sun.COM These opinions are my own and no one elses, but you knew that didn't you. "I tell you this parrot is bleeding deceased!"
deven@rpi.edu (Deven T. Corzine) (06/03/90)
In article <2474@awdprime.UUCP> robin@sabre.austin.ibm.com (Robin D. Wilson/1000000) writes: Robin> According to the lattice manual, the rename(old,new) call will Robin> rename old to new. Unfortunately, it will not remove new, if Robin> it exists, and it will not allow you to specify a path to Robin> "new". On 31 May 90 20:00:32 GMT, cmcmanis@stpeter.Eng.Sun.COM (Chuck McManis) said: Chuck> You are doing the rename on the same Volume yes? If you rename Chuck> from Foo:A to Foo:B then A should be removed. If you rename Chuck> from Foo:A to Bar:B then what you get is a copy of A to B, and Chuck> A is not deleted. No, it seems you missed the point -- If you rename Foo:A to Foo:B and Foo:B already exists, it will not be removed. That was the complaint. I believe the other bit about the path probably means you can't give the name of a directory as a destination... Deven -- Deven T. Corzine Internet: deven@rpi.edu, shadow@pawl.rpi.edu Snail: 2214 12th St. Apt. 2, Troy, NY 12180 Phone: (518) 271-0750 Bitnet: deven@rpitsmts, userfxb6@rpitsmts UUCP: uunet!rpi!deven Simple things should be simple and complex things should be possible.