DeleteFiles (read-only)

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jun 8, 2022
Company:

Hi, i'm trying to delete read only files, but I get an error

DeleteFiles(TempFilesDir(),"*.xml")

 
#2
People who like this:0Yes/0No
Administrator
Rating: 23
Joined: Oct 3, 2019
Company:

Hi Murat,

try the following code:

Code
Procedure DeleteReadOnlyFiles()
    
   stringTempFilesDir =  TempFilesDir();
   arrFiles = FindFiles(stringTempFilesDir, "*.xml");
   For Each curFile In arrFiles Do 
       curFile.SetReadOnly(False);
   EndDo;
   DeleteFiles(stringTempFilesDir,"*.xml");
    
EndProcedure

 
#3
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Jun 8, 2022
Company:

Thank you.

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.