So, I figure once I get a list of these files, I can just use tFileDelete to delete them. (I assume I would feed into tFileList and then make a connection to tFileDelete, like in the pic, but I'm not positive.)
What I don't know is how to read a directory and get a list of the (zip) files that are older that today minus x # of days.
hi guys how are you.
i am Fabricio and i am from Brazil.
i am working in develop process for File delete Old.
figure the process, i am student of science of Computing.
In tMap:
Convert TimeStamp Unix for Date:
new java.util.Date((long)(row1.mtime/1000*1000))
This is how I do it (I call it pruning).
I create some Variables in a tMap and then use Var.prune to determine if the file path should be emitted.
// Returns a long based on the oldest date you want to keep
((java.util.Date) globalMap.get("OldestDate")).getTime()
// Returns the number of milliseconds that the file (based on tFileProperties mtime) has passed it's pruning time.
Var.oldestMTime - archiveAllDirectories.mtime
// Returns true or false
// This value determines if the file path is output from a tMap.
Var.millisecondsPastPruning > 0 ? true : false
This image shows a SubJob that collects the file names that need pruning. You can then iterate this to delete.