|
On Mon, 12 Aug 2002, Phil wrote: > > Qp0lRenameKeep() copies. > Qp0lRenameUnlink() moves. > Ummm... are you sure? Because the manual for Qp0lRenameKeep says: "The Qp0lRenameKeep() function renames a file or a directory specified by old to the name given by new." "If new already exists, Qp0lRenameKeep() fails with the [EEXIST] error" And for Qp0lRenameUnlink, it says: "The Qp0lRenameUnlink() function renames a file or a directory specified by old to the name given by new." "If new already exists, it is removed before old is renamed to new." To me, this says that the only difference between the two APIs is what happens when the destination file exists. The first one fails with an error, the second one replaces the existing file. Nowhere in this description do I see something that says that the source file is kept (which would be a copy) But hey... why guess if we can test this theory on an actual machine? 1) Use EDTF to create a stream file (doesn't matter what's in it) called /myfile 2) compile this trivial program: H DFTACTGRP(*NO) ACTGRP(*NEW) D RenameKeep PR 10I 0 ExtProc('Qp0lRenameKeep') D old * value options(*string) D new * value options(*string) D msg S 52A c if RenameKeep('/myfile': '/yourfile') < 0 c eval Msg = 'failed' c else c eval Msg = 'succeeded' c endif c dsply msg c eval *inlr = *on 3) run that trivial program. 4) type: wrklnk '/myfile*' <-- says "Cannot find object..." type: wrklnk '/yourfile*' <-- shows the file. So, obviously the Qp0lRenameKeep() API does NOT do a copy. It does a rename. Or am I misinterpreting what you mean by "copy"?
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.