In a pre set directory loop through the files and delete those that are older than 2 minutes.
Processing the contents of a directory was done using the tFileList step. However, it seems that it only retrieves the File Path of a file and not any of the other properties associated with a file like Size, Created Date, Last Changed etc. Searched the help file, forum and tutorials for the keywords file, time and date. Sadly to no avail. Now, I probably think that this can be done within TOS, but will require some custom code, ie. Java Step but I was wondering if there was a different way of doing it. Sadly I don't have the programming skills to create this kind of functionality. Any help will be appreciated. Regards,
I think you can be interested in 984 (one year old and suspended but can be reactivated). I thought creating a specific component that would output all data (filemtime, size, owner, ...) into a data flow (a row link) and you suggest to have it in tFileList global variables. I do still prefer the dedicated tFileProperties dedicated component because you can be interested in file properties outside tFileList. Imagin you have your file list in a database table. I encourage you to add a note in this feature request and monitor it so that we're aware some users need it.
Thanks for the suggestion; sadly the file date is the most important one at present. That said, I do feel that all the other file properties will have a use as well. In this case a message has to go out if a file is older than a particular date. Granted, it's not really ETL but since the file object is already part of TOS I had thought that the extension of the file step or addition of the properties step would be appropriate. Kind regards, Anne.
Volker, thanks for this comment. This is indeed something I might be able to process further down the road. It is indeed a work around and it will have to be documented as such. In any case, it will allow me to do a few things that are on the fringe of ETL with the same tool. Will give this a go on my other notebook in the next couple of days. Again, thanks for helping out. Regards, Anne.
This will result in the Date field being populated with a long number which represents a the date in milliseconds after 1970. This date can then be used to do all sorts of comparison and calculations. Again, thanks for responding so quickly and for all the useful information you have provided me.