Login Page - Create Account

Support Board


Date/Time: Wed, 19 Mar 2025 08:09:21 +0000



Post From: ACSIL - file in use after closing it

[2022-10-14 21:30:12]
tomna1993 - Posts: 24
I have a function (see below) to open a file I created before and append data to it then close the file. Sometimes if I want to delete the file it shows me that the file is in use by sierra, but it's not. Could you help me figure out what happens and how can I solve this problem?
//--------------------------------------------------------------------

// Save data to log file

void SaveDataToLogFile(SCStudyInterfaceRef sc, SCString Path, SCString DataToSave)

{

int FileHandle;



sc.OpenFile(Path, n_ACSIL::FILE_MODE_OPEN_TO_APPEND, FileHandle);



unsigned int BytesWritten = 0;

unsigned int BytesToWrite = DataToSave.GetLength();



sc.WriteFile(FileHandle, DataToSave, BytesToWrite, &BytesWritten);



sc.CloseFile(FileHandle);

}

imageFileInUse.PNG / V - Attached On 2022-10-14 21:29:30 UTC - Size: 17.03 KB - 110 views