![]() |
#8 |
NavAx
|
Вот тестовый job-ик . В нем для простоты отсутствуют процедуры записи. Только создание и попытка удаления файлов. Почему возникает ошибка удаления ?
static void Testdf(Args _args) { container Files = ['1.txt', '2.txt', 'ABC.txt']; int Handle=0, i; str FileName; str Path = 'C:\\Temp\\'; dialogButton Db; int DelFileErrCode; ; for ( i=1; i<= conlen(files); i+=1) { if (! WinApi::fileExistsClient(Path+conpeek(files,i))) { WinAPI::createFile(Path+conpeek(files,i)); } } pause; [Handle, FileName] = WinApi::findFirstFile(Path + '*.txt'); if (Handle == -1) return; Db = BOX::yesNo(" В указанном каталоге существуют файлы. Удалить?",DialogButton::Yes); if (Db == DialogButton::Yes) { while (FileName) { WinApi::deleteFile(Path + FileName); DelFileErrCode = WinApi::deleteFile(Path + FileName); if (DelFileErrCode != 0) { box::info(' Ошибка № ' + int2str(DelFileErrCode) + ' при удалении файла ' + Path + FileName); } FileName = WinApi::findNextFile(Handle); } WinApi::findClose(handle); } } |
|