How do you make a variable that deletes all files in a folder

Questions and answers on how to get the most out of FFAStrans
Post Reply
JoJo
Posts: 1
Joined: Thu Apr 09, 2020 10:08 am

How do you make a variable that deletes all files in a folder

Post by JoJo »

Hello,

This is my first time working with FFAStrans and I'm still rather new to it. I was wondering if any of you knew a variable that would delete any file that was in specified folder.

the way i would use it would be following the workflow I made (see image below) and at the end of completing the workflow automatically direct it to delete the files in the "IN Folder" because I intend to leave a back-up in the folder anyways. Is that possible? Is it only possible with a ftp-server if so, got any pointers for me to get to that point or is it a variable in the ftp-server itself?

I'm just a young student, so excuse me if i'm asking a lot or if I missed a setting that would help me keep clean the "IN-folder" after it has done it's task.
One of my workflows, I intend to use that variable for multiple workflows, if possible.
One of my workflows, I intend to use that variable for multiple workflows, if possible.
Screen Shot 2020-04-16 at 11.42.53 AM.png (153.31 KiB) Viewed 5607 times
[img]
momocampo
Posts: 595
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: How do you make a variable that deletes all files in a folder

Post by momocampo »

Hello Jojo, welcome to the forum and thanks to use FFAStrans !

It is really easy to do. If I understand well, you just want to delete your original files into your "Video-IN" folder once the workflow will be done.
You just have to create a "command-executor" node and put after the delivery folder. Edit it and write this command :

Code: Select all

%comspec% /c "del /f /q  "%s_original_full%""
Your original files will be deleted :)

Other solution is possible too: Instead of do a backup of your original files (your backup node), you can move your original files into your backup folder.
So, instead of :

Code: Select all

%comspec% /c "del /f /q  "%s_original_full%""
do :

Code: Select all

%comspec% /c "move  "%s_original_full%" "path of your backup folder""
To resume:
- you backup your original files AND you delete it at the end OR
- you don't backup original files but you move them at the end of workflow.

Hope it helps.

Cheers.
admin
Site Admin
Posts: 1687
Joined: Sat Feb 08, 2014 10:39 pm

Re: How do you make a variable that deletes all files in a folder

Post by admin »

Hi JoJo,

Be aware that running a dos command like "del" and "move" if "%s_original_full%" points to an FTP-source, will not work yet. Currently the "%s_original_full%" only stores the full path to a file, not credentials needed to delete or move a file from FTP.

-steinar
ThomasM
Site Admin
Posts: 231
Joined: Wed Feb 22, 2017 6:36 am

Re: How do you make a variable that deletes all files in a folder

Post by ThomasM »

Hi JoJo,

be aware of using "MOVE" - especially when moving files from one drive to another. Use one node with "COPY (originalFile to destination / Backup-Disk)" and a following node with "DEL (OriginalFile from source-Disk)". You can use "MOVE" when you leave the file on the same drive, just moving it to another directory.

In your workflow there is also an "A/V-Media"-Node - maybe you just do not need it. If you need it, add a "Channel-Mapper"-Node to specify only the audio-channels you need.

After your destination-"FOLDER"-Node add a command-executioner-Node with the "DEL"-Command Momocampo mentioned.

just my 2 cents
Post Reply