I’m using an adapted version of the Rhythm.BackupRFADeleter to delete backup families and have the option to include sub-folders. The only difference i have made to the node is to use Directory.ContentsAll instead of the Directory.Contents.
I have saved it as a custom node, however, when run it does not delete any backup families but if i take the content out of the custom node and place it in the script, using the same inputs, it finds the backup families and deletes them. Any idea why this might be?
import sys
sys.path.append(r"C:\Program Files (x86)\IronPython 2.7\Lib")
import os
import re
filelist = list()
for root, dirs, files in os.walk(IN[0]):
for file in files:
matches = re.match(".*\.[0-9]+\.(rfa|RFA)$", file)
if matches:
backup = os.path.join(root, file)
filelist.append(backup)
os.remove(backup)
OUT = filelist