Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
BartG
Contributor
Contributor

tFileCopy doesn't work due to file in use by another process

Hi,

 

This is my first project in Talend Open Studio.

 

What I'm trying to do:

  • An external job copies CSV files to a folder PROCESSING.
  • tWaitForFile checks this PROCESSING folder and gives the files it finds to tFileInputDelimited.
  • tFileInputDelimited gives the file to tAdvancedFileOutputXML to map it to an XML structure.
  • The XML file has to be written to a TRANSFORMED folder.
  • tFileCopy needs to moved the CSV file from PROCESSING to PROCESSED.

 

This all works, except for moving the file from PROCESSING to PROCESSED. by tFileCopy.

 

  • When I uncheck the option "Remove source file" from tFileCopy (copy), then everything works, except that the CSV file from PROCESSING is not deleted.
  • When I check the option "Remove source file" from tFileCopy (move), then nothing works anymore and running the job fails with an exception saying: "java.nio.file.FileSystemException: C:\temp\Testfolder\Processing\70044694-13-03_sn98266620.txt -> C:\temp\Testfolder\Processed\20221116_133348_70044694-13-03_sn98266620.txt: Het proces heeft geen toegang tot het bestand omdat het door een ander proces wordt gebruikt.". Meaning something like "The process cannot access the file because it's being used by another process".

 

Should I use another tWaitForFile to wait for the presence of the mapped XML file before trying to move/delete the original CSV file with tFileCopy? Or how can I be sure that the CSV file is not in use anymore by an earlier step?

 

0695b00000Z1oT0AAJ.jpgThanks!

Labels (2)
2 Replies
BartG
Contributor
Contributor
Author

Aha, I think I've found it: changed the trigger between tAdvancedFileOutputXML and tFileCopy to "OnComponentOk", and that seems to work. I guess the file move now waits until the XML has been written completely.

 

0695b00000Z1orCAAR.pngThis seems to work.

Anonymous
Not applicable

Hello,

Yes, you are right. As tFileCopy component can be used as a standalone component, onsubjobOK connection type will be better based on your use case. In this way, it will start only when the previous subjob completely finishes.

Best regards

Sabrina