[resolved] Problem delete file

One Star

[resolved] Problem delete file

Hi i create a job talend ho i extract the date of a database and insert this date in a xml file
I will catch the error and for this reason i try experiment to see the behaviour of the program..If there is a error during the sql query..talend create the xml with 0 bytes and after call tLogCatcher in this call i will delete this file..but if i use 
tFileDelete 
the file is not deleted, if i use java with this instruction 

File file=new File(path)
file.delet()

the file isn't delect, but if i use file.getName i read the name if i use 

System.out.println(file.canWrite());
System.out.println(file.canRead());
System.out.println(file.canExecute());
System.out.println(file.exists());


i read true


How can i delecting this file?
One Star

Re: [resolved] Problem delete file

If i try only to delete the file in another job the file is deleted
Four Stars

Re: [resolved] Problem delete file

Hi,

Try with flow tFileList-->tfileDelete(Use tFileListCurrentFilepath in place of file name) Use appropriate filter to detect the required file.

Thanks
Vaibhav
One Star

Re: [resolved] Problem delete file

Not function....The main job call the tCatchLogger and i create tFileList iterate tjava that take the name of the current file and after i have if condition ( if currentfile=myfile))--delete file whit ((String)globalMap.get("tFileList_1_CURRENT_FILEPATH")) how name of file...but the file is not deleted
One Star

Re: [resolved] Problem delete file

The problem is that i have

Postrgresql output tmap filexml

If i have a error in the Postgresql component talend complete the operation between postgresql and tmap file xml create a xml file with 0 byte and after call the catchlogger, is possible to block the operation before tmap or filexml??
One Star

Re: [resolved] Problem delete file

or block the creation of the xml file if there is a error with a check in the component xml?
Four Stars

Re: [resolved] Problem delete file

Yes, you can use tbuffer component in place of file output component. Use if condition for file creation if required.
Thanks
Vaibhav

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Have you checked out Talend’s 2019 Summer release yet?

Find out about Talend's 2019 Summer release

Blog

Talend Summer 2019 – What’s New?

Talend continues to revolutionize how businesses leverage speed and manage scale

Watch Now

6 Ways to Start Utilizing Machine Learning with Amazon We Services and Talend

Look at6 ways to start utilizing Machine Learning with Amazon We Services and Talend

Blog