Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!apple!well!svc From: svc@well.UUCP (Leonard Rosenthol) Newsgroups: comp.sys.mac.programmer Subject: Re: Move a file from one directory to another. Summary: One of two ways... Keywords: rename, mv Message-ID: <11894@well.UUCP> Date: 29 May 89 20:06:40 GMT References: <2638@lethe.UUCP> Lines: 27 In article <2638@lethe.UUCP>, drew@lethe.UUCP (Drew Sullivan) writes: > How does a program move a file from one directory to another. > > Rename("\pvol:dir:file", 0, "\pvol:dir2:file"); > > fails. I know it can be done, the finder does it. > > Think-C's rename(from, to) should have handled the case > for moving from directory to directory, but it doesn't either. > There are two ways of doing a 'move' that I use depending on the situation. 1) Use PBCatMove (IM IV-157) which will allow you do a DIRECT move from one directory/folder to another ON THE SAME VOLUME! If it is possible that the user will be moving the file across volumes then you will need to do the following. 2) Copy the file from A to B and the delete the original. It may not be the cleanest thing to do, but it works! -- +--------------------------------------------------+ Leonard Rosenthol | GEnie : MACgician Lazerware, inc. | MacNet: MACgician UUCP: svc@well.UUCP | ALink : D0025