home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!yale.edu!jvnc.net!netnews.upenn.edu!netnews.noc.drexel.edu!king.mcs.drexel.edu!udsugar
- From: udsugar@mcs.drexel.edu (David Sugar)
- Newsgroups: comp.sys.mac.programmer
- Subject: Help, PBHCopyFile..
- Message-ID: <1993Jan3.081158.3294@mcs.drexel.edu>
- Date: 3 Jan 93 08:11:58 GMT
- Distribution: usa
- Organization: Drexel University, Dept. of Math. and Comp. Sci.
- Lines: 53
-
-
- I am trying to copy a file with PBHCopyFile, and it seems like it
- should be simple enough, but I keep getting the error -50, Error In
- User Parameter List (which isn't helping to much).
-
- Anyway, I have a HParamBlockPtr and set the copyParam to the
- following, the ioCompletion to NIL, the ioVRefNum to the source
- vRefNum (-1 in this case), the ioDirID to the source directory
- ID (129 in this case), the ioNamePtr to my name.
-
- Then set ioDstVRefNum to the destination refNum (again -1)
- the ioNewDirID to the new directory ID (19 in this case)
- and the ioNewName to the filename (which is the same name
- as the ioNamePtr pointed to.
-
- I set ioCopyName to NIL and the call the PBHCopyFile. It
- always gives the error -50. I'm not quite sure what I've
- missed. I'll include the code I'm routine I working with,
- maybe it will help.
-
-
- void CopyFile (CFile *source, CFile *dest)
- {
- HParamBlockRec copy_data;
- OSErr err;
-
- if (dest->ExistsOnDisk ())
- dest->ThrowOut ();
-
- copy_data.copyParam.ioCompletion = NILP;
- copy_data.copyParam.ioNamePtr = source->name;
-
- copy_data.copyParam.ioVRefNum = source->volNum;
- copy_data.copyParam.ioDirID = source->dirID;
-
- copy_data.copyParam.ioNewName = source->name;
- copy_data.copyParam.ioDstVRefNum = dest->volNum;
- copy_data.copyParam.ioNewDirID = dest->dirID;
-
- copy_data.copyParam.ioCopyName = NILP;
- err = PBHCopyFile (©_data, FALSE);
-
- }
-
- I am sure that the fields data fields of source and data are
- correct when the call is made, so that isn't a problem..
-
-
- Thanks
-
-
- Dave Sugar
- udsugar@mcs.drexel.edu
-