简体   繁体   中英

How to induce a timedelay when transferring the file from one directory to another by using twaitforfile or custom java code?

I am using talend to pickup file from source folder and transfer to the destination folder,however i want to pickup the file for processing only if the file is completely written in the source or not during/when the file is actively being copied into the source folder.

I realize that in talend when trying to move the file from source to dest. when the file is being still written into source folder-it shows an error message that "file is still being used by another proces" however i dont want that error to be triggered for each every run,i would want to skip and move to the next file in the iteration folder.

Can i use a twait or twaitforfile between components or add java code to handle it such that "presenttime(sysdate)-filetime(arrivaltimeinto the folder)>timedifference(lets say around 3-5 minutes)"

Only if the condition is satisfied move the file to destination folder.

Please suggest which is the best efficient way to handle this.

In advanced settings of tWaitForFile, you have an option "WAIT_RELEASE": you can set it, and when a file is detected, it will perform a 2d check XXXms after the first one, to make sure that the file is released (so that it is not actively being copied to the repository). When the file is fully copied, you are then able to use it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM