Eugeniusz Rink Posted December 22, 2020 Share Posted December 22, 2020 Hi. How to configure UniGui to automatically delete cache directories after finished sessions? The UniGui application works as a DLL on IIS. Link to comment Share on other sites More sharing options...
artem_niko Posted April 27, 2022 Share Posted April 27, 2022 On 12/23/2020 at 5:20 AM, slot said: Hi. How to configure UniGui to automatically delete cache directories after finished sessions? The UniGui application works as a DLL on IIS. +1 How make this? Link to comment Share on other sites More sharing options...
Eugeniusz Rink Posted April 27, 2022 Author Share Posted April 27, 2022 13 hours ago, artem_niko said: +1 How make this? I have not solved this problem. I noticed that UniGui deletes unnecessary sessions itself, but I did not find a time relationship. Link to comment Share on other sites More sharing options...
artem_niko Posted November 9, 2022 Share Posted November 9, 2022 Anybody have ideas? Link to comment Share on other sites More sharing options...
irigsoft Posted November 9, 2022 Share Posted November 9, 2022 1 hour ago, artem_niko said: Anybody have ideas? Hi, I don't know what you need to do to make unigui clear cache files, but you can create your own function that clears files older than a few days when uniGui Server starts or using TThreatTimer here's a few examples: https://stackoverflow.com/questions/54321253/delphi-delete-files-in-a-directory-older-than-x-days-and-or-having-a-special-fi http://www.delphigroups.info/2/35/521671.html search results: https://www.google.com/search?q=delphi+clear+older+files&oq=delphi+clear+older+files&aqs=chrome..69i57j0i22i30j0i390.6735j0j7&sourceid=chrome&ie=UTF-8 Link to comment Share on other sites More sharing options...
irigsoft Posted November 15, 2022 Share Posted November 15, 2022 @artem_niko, hi, did my suggestion help you, just for the information? 1 Link to comment Share on other sites More sharing options...
artem_niko Posted November 17, 2022 Share Posted November 17, 2022 On 15.11.2022 at 13:30, irigsoft said: @artem_niko, привет, помогло ли тебе мое предложение, просто для информации? Hello! Yes 1 Link to comment Share on other sites More sharing options...
eduardosuruagy Posted November 18, 2022 Share Posted November 18, 2022 I couldn't use these examples, do you have any of them that you got? The example I used does not exclude the folders Link to comment Share on other sites More sharing options...
irigsoft Posted November 18, 2022 Share Posted November 18, 2022 2 hours ago, eduardosuruagy said: I couldn't use these examples, do you have any of them that you got? The example I used does not exclude the folders Hello, what do you need? Link to comment Share on other sites More sharing options...
eduardosuruagy Posted November 19, 2022 Share Posted November 19, 2022 On 18/11/2022 at 02:07, irigsoft said: Olá, o que você precisa? I was wondering how you guys managed to delete cache folders in a certain number of days? Link to comment Share on other sites More sharing options...
irigsoft Posted November 19, 2022 Share Posted November 19, 2022 On 11/19/2022 at 4:28 PM, eduardosuruagy said: I was wondering how you guys managed to delete cache folders in a certain number of days? I use this in my desktop application to only delete files from a temporary directory. // ================================================================= // Delete files (mask) from a directory that are older than X days // Returns number of files deleted, but will raise an exception if // unable to delete a file (eg. Read Only attribute) if // AFailOnError is true. // // NOTE : AOlderThanDays = 0 will delete ALL files matching mask // ================================================================= function sysDeleteOlderFiles(const AFileMask : AnsiString; AOlderThanDays : word; AFailOnError : boolean = false) : AnsiString; var rDirInfo : TSearchRec; iResult,iError : integer; dtFileDate,dtNow : TDateTime; sFilePath,sErrMess : string; label ENDAll; begin sFunctionName := 'sysDeleteOlderFiles'; sErrMess := ''; iResult := 0; dtNow := Date; sFilePath := ExtractFilePath(AFileMask); iError := FindFirst(AFileMask,faAnyFile,rDirInfo); // Itterate thru files found with mask while iError = 0 do begin // Eclude Directories if (rDirInfo.Name <> '.') and (rDirInfo.Name <> '..') and (rDirInfo.Attr and faDirectory <> faDirectory) then begin dtFileDate := FileDateToDateTime(rDirInfo.Time); // Does the file meet deletion days criteria ? if trunc(dtNow - dtFileDate) + 1 >= AOlderThanDays then begin // Delete the file - raise exception if fail and AFailOnError set if not DeleteFile (sFilePath + rDirInfo.Name) and AFailOnError then begin sErrMess := 'Failed on file: ' + sFilePath + rDirInfo.Name + '\n ' + SysErrorMessage(GetLastError); raise Exception.Create(sErrMess); end; inc(iResult); end; end; iError := FindNext(rDirInfo); end; EndAll : begin FindClose(rDirInfo); if sErrMess <> '' then Result := sErrMess else Result := '';//IntToStr (iResult); end; end; Link to comment Share on other sites More sharing options...
eduardosuruagy Posted December 19, 2022 Share Posted December 19, 2022 I still can't delete the files, could someone help me? The routine when it gets here in this part of the code (rDirInfo.Attr and faDirectory <> faDirectory) then appears like this rDirInfo.Attr = 2064 this appears in the folders Link to comment Share on other sites More sharing options...
Ronald Posted January 8 Share Posted January 8 Any news on this topic? Why does the ISAPI don't delete the cache files? Is this a bug? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now