delete

  • 28 May

    Delete all contents of a destination folder before files are moved

    Q: Is there a way to delete all contents of a destination folder before files are moved/not just overwriting them? I am unzipping a large folder with files daily, most files are named the same thing so they can overwrite them. Have a few that are named with dates and times so they just end up staying in the folder.

    A: If the unzip folder is always the same, the following solution could help you. We added a script that will delete all files and subfolders when ‘On Rule Begin’ is triggered. The path you need to use in the script is the one you will use in your UNZIP as Destination setup.

    – Open Pascal Script Setup

    limagito file mover pascal script

    • Enable and Add the following ‘On Rule Begin’ Pascal Script. In this example our Unzip path = C:\Test\Out\UNZIP\

    Don’t forget to adjust the ctOutputPath const, must end with a \

    Const
      ctOutputPath = 'C:\Test\Out\UNZIP\';
    Begin
      psExitCode:= 1;
      // ... add your code here
      psLogWrite(1, '', 'Delete Tree: ' + ctOutputPath);
      psDeleteFiles(ctOutputPath, '*.*');
      psDeleteTree(ctOutputPath, True);
    End.

    Delete all contents of a destination

    #filetransfer #mft #filemanagement

    If you need any info  about this ‘Delete all contents of a destination’ request, please let us know.

    Best regards,

    Limagito Team

    By Limagito-Team Pascal Script WIN ZIP ,
  • 30 May

    Q&A 13: is it possible to retry a file delete if it fails in LimagitoX File Mover

    Q: Is it possible to automatically retry a file delete if it fails

    A: Yes this is possible since version v2020.5.30.0

    Select ‘Function Setup’ >> Common Tab

    Here you’ll find ‘Retries after failure’ and ‘Seconds between each retry’. In the screenshot below we’ll try 3 times and will wait 5 seconds between each retry.

    LimagitoX Retry File Delete option

    As long as the source file is locked it will retry. If it is unlocked within the retries it will not give an error.

    LimagitoX File Delete Retry RunTime Log succes

    If the file is still locked after all the retries then it will give an error + information why it couldn’t delete the file.

    LimagitoX File Delete Retry RunTime Log error

    In version v2020.6.1.0 we added the ‘On Error Event & On Error Execute Command’ if a Delete after Move fails.

    If you need help with the ‘retry a file delete’, please let us know.

    Regards,

    Limagito Team

    By Limagito-Team Q&A , ,
  • 16 May

    Q&A 10: Can we remove empty directories in LimagitoX File Mover

    Q: Can we create a rule which will remove empty directories once a week, not every scan?
    A: Yes this is possible. Let’s start with a new rule. Source will be the Windows folder you want to scan. Trigger it once a week and add a dummy Pascal Script as destination. Some screenshots to get you started.

    1.- Setup the Schedule.

    Disable the Scan Timers because we are going to use the Scheduler option instead.

    LimagitoX-Schedule-Disable-Scan-Timers

    Swith from Timer to Scheduler Tab and <Add> a Schedule. Change the setup of this schedule to once a week and <Save>.

    LimagitoX-Remove-Empty-Directories-Schedule

    2.- Set the File PreFix Filter to something impossible so it will never pickup files:

    LimagitoX-File-Prefix-Filter-Setup

    3.- Directory Filter Setup, enable ‘Include Subdirectories’ and ‘Delete Empty Subdirectories On Scan’:

    LimagitoX-Dir-Filter-Delete-Empty-Folders

    4.- Add a Dummy ‘Pascal Script’ as Destination:

    LimagitoX-Destination-Pascal-Script

    If you need help with ‘remove empty directories ‘, please let us know.

    Regards,

    Limagito Team

    By Limagito-Team Q&A , , ,
1 2
SEARCH