<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: tfiledelete_does_not_delete_file in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322690#M92612</link>
    <description>&lt;P&gt;to do&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in Prejob , add ps as globalMap variable at the end of code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;globalMap.put("ps",ps);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then before deleting file in tPostJob, close the stream using tJava&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;((java.io.PrintStream)globalMap.get("ps")).close();&lt;/P&gt;</description>
    <pubDate>Wed, 22 May 2019 13:31:59 GMT</pubDate>
    <dc:creator>akumar2301</dc:creator>
    <dc:date>2019-05-22T13:31:59Z</dc:date>
    <item>
      <title>tfiledelete_does_not_delete_file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322686#M92608</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;I have a problem with the tfile delete component. I build a job to upload a logfile to salesforce. To do this i have a Prejob which redirects the console output to a file with these lines:&lt;/P&gt; 
&lt;PRE&gt;context.WorkingDir = System.getProperty("user.dir");
context.Pid = this.pid;
System.out.println(context.Pid);
System.out.println(context.WorkingDir);
context.LogFile = (context.WorkingDir + "\\" + context.Pid + "_log");

java.io.PrintStream ps = new java.io.PrintStream(new java.io.FileOutputStream(context.LogFile));
System.setOut(ps);&lt;/PRE&gt; 
&lt;P&gt;Later i use tLogCatcher to collect the Logs and read the file as shown here:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="talend_1.png" style="width: 863px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4M4.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/142824i78D9CD154D85B5CC/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4M4.png" alt="0683p000009M4M4.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;The Logfile is uploaded successfully - after that i want to delete the Logfile within a Postjob:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="talend_2.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4ME.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/152592iE7E7099336B619B8/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4ME.png" alt="0683p000009M4ME.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;But i get an exception that the file could not be deleted:&lt;/P&gt; 
&lt;P&gt;&lt;SPAN class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="talend_3.png" style="width: 999px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009M4MO.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/157759i8B3E5D458E4B3969/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009M4MO.png" alt="0683p000009M4MO.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;I thought that the file is maybe not properly closed, but i don't know how to do this i tried:&lt;/P&gt; 
&lt;PRE&gt;new java.io.FileOutputStream(context.LogFile).close();&lt;/PRE&gt; 
&lt;P&gt;But that didn't work either.&lt;/P&gt; 
&lt;P&gt;It would be great if someone could help/explain me what i'm doing wrong here.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards,&lt;/P&gt; 
&lt;P&gt;Olli&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 08:12:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322686#M92608</guid>
      <dc:creator>olni</dc:creator>
      <dc:date>2019-05-22T08:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: tfiledelete_does_not_delete_file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322687#M92609</link>
      <description>Hello&lt;BR /&gt;&lt;BR /&gt;Just to undersdand&lt;BR /&gt;what not simply doing :&lt;BR /&gt;&lt;BR /&gt;tLogCatcher -----------------&amp;gt; SaleForce Insert&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 May 2019 10:10:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322687#M92609</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-22T10:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: tfiledelete_does_not_delete_file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322688#M92610</link>
      <description>&lt;P&gt;.. i also want to have a summary of what ID's are &lt;U&gt;successfully&lt;/U&gt; uploaded. But LogCatcher only logs errors from java exception or tdie/twarn.&lt;BR /&gt;That is the reason i store everything in a file before i upload it.&lt;/P&gt; 
&lt;P&gt;The result looks like this:&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;PRE&gt;### Starting Accounts SF2ERP_SQL  ...
SalesforceURL: https://login.salesforce.com/services/Soap/u/44.0
ERP          : 192.168.0.65/Kunden
Lastrun      : Wed May 22 09:19:54 CEST 2019
LastrunSQL   : 2019-05-20T05:00:51.000Z
&lt;BR /&gt;knr
214578
220256
220039
215620
208529&lt;BR /&gt;...&lt;BR /&gt;...&lt;/PRE&gt; 
&lt;P&gt;It all works fine except the removing of the logfile.. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Olli&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 10:50:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322688#M92610</guid>
      <dc:creator>olni</dc:creator>
      <dc:date>2019-05-22T10:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: tfiledelete_does_not_delete_file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322689#M92611</link>
      <description>I suggest you try temporary files&lt;BR /&gt;&lt;BR /&gt;something like tCreateTemporaryFile ...&lt;BR /&gt;</description>
      <pubDate>Wed, 22 May 2019 11:02:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322689#M92611</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-22T11:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: tfiledelete_does_not_delete_file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322690#M92612</link>
      <description>&lt;P&gt;to do&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in Prejob , add ps as globalMap variable at the end of code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;globalMap.put("ps",ps);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then before deleting file in tPostJob, close the stream using tJava&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;((java.io.PrintStream)globalMap.get("ps")).close();&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 13:31:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322690#M92612</guid>
      <dc:creator>akumar2301</dc:creator>
      <dc:date>2019-05-22T13:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: tfiledelete_does_not_delete_file</title>
      <link>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322691#M92613</link>
      <description>&lt;P&gt;Hi Akumar,&lt;/P&gt; 
&lt;P&gt;thanks again for your help, this works perfectly.&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Oliver&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 13:47:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/tfiledelete-does-not-delete-file/m-p/2322691#M92613</guid>
      <dc:creator>olni</dc:creator>
      <dc:date>2019-05-22T13:47:23Z</dc:date>
    </item>
  </channel>
</rss>

