2004-05-15
12:33 AM
- last edited on
2022-12-13
09:56 PM
by
Daniel Kassai
2004-05-17 06:47 PM
const char* networkFileLocation = "Public:CAD_Standards:KA-Update:KA-Add-On";
const char* localFileLocation = "Local_Disk:Applications:ArchiCAD 8.1 folder:Add-Ons:KA:KA-Add-On";
// define Location objects
IO::Location networkFile (networkFileLocation);
IO::Location localFile (localFileLocation);
GSErrCode err;
GSErrCode err2; // temporary to help track down delete failure
err = IO::fileSystem.Copy (networkFile, localFile);
if (err == IO::Folder::SourceNotFound)
{
char msgStr[256];
CHCopyC ("Error, Source not found", msgStr);
ACAPI_WriteReport (msgStr, false);
}
else if (err == IO::Folder::TargetExists)
{
err2 = IO::fileSystem.Delete(localFile);
if (err2)
{
char msgStr[256];
CHCopyC ("Delete Failed", msgStr);
ACAPI_WriteReport (msgStr, false);
return;
}
IO::fileSystem.Copy(networkFile, localFile);
char msgStr[256];
CHCopyC ("Updated from source", msgStr);
ACAPI_WriteReport (msgStr, false);
}
return;
I cannot figure out while I keep getting the "Delete failed" message, and the Delete function fails. I suspect that is may have to do with the mixture of fileSystem and Folder namespaces/object behavior.2004-05-20 04:28 PM
"TomWaltz" wrote:
I cannot figure out while I keep getting the "Delete failed" message, and the Delete function fails. I suspect that is may have to do with the mixture of fileSystem and Folder namespaces/object behavior.
2004-05-20 04:57 PM
What you can do is use a separate Add-On, which does nothing else just updates your original Add-On. Just make sure first that the original Add-On is already unloaded.Wow, you read my mind.