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

Announcements
Qlik Connect 2026 Agenda Now Available: Explore Sessions
cancel
Showing results for 
Search instead for 
Did you mean: 
Sanjay5
Contributor III
Contributor III

Question on tCreateTemporayFile

Hi,

 

I wanted to know if we can control the name of the while using tCreateTemporaryFile component:

 

I want to create a file with name "TEST.txt"

 

This component always adds ".tmp" as extention by default.

 

Is there a way to stop adding ".tmp" as extention.

I already tried keeping spaces in "Suffix" field, and it still adds ".tmp" in the file. (See attached"

 

 

Labels (1)
1 Solution

Accepted Solutions
Evandao
Contributor III
Contributor III

Hi,

 

  In my last answer it was not clear that if the character space is passed in the "Suffix" field, the component generates the file without the extension "tmp". See the pictures:. 

 

 

0683p000009LtuE.png0683p000009LtpF.png0683p000009Ltfj.png

View solution in original post

7 Replies
cterenzi
Specialist
Specialist

Just curious... why do you want to do this?
Evandao
Contributor III
Contributor III

Hi,

 

I've tested the component and to change the extension of the temporary file, just put the extension in the suffix field.

 

See attached image.

 

Hugs, Evando

0683p000009LtsN.png0683p000009LtsS.png

Sanjay5
Contributor III
Contributor III
Author

Thanks for the response,

 

I am able to change the extension using suffix field in the component, If I keep the suffix field empty, It adds ".tmp" by default which is what I don't want.

If should just create "MyName" as per below example, but what it does is, It creates a file "MyName.tmp"

Evandao
Contributor III
Contributor III

 Hi,

 

From what I understand, you need the temporary file to be generated without extension.

 

By default the component is prepared to use the ".tmp" extension when the parameter is not passed.

 

I did a test and put as a parameter a blank and the file was generated without any extension.

 

I believe that is what you need. Right ?

 

Thank you, Evando

 

 

Sanjay5
Contributor III
Contributor III
Author

Thanks for your help,

Actually, What I was expecting is that component should not add ".tmp" as extension if suffix is kept blank.

In this case file name should be "MyName" instead of "MyName.tmp"

Evandao
Contributor III
Contributor III

Hi,

 

  In my last answer it was not clear that if the character space is passed in the "Suffix" field, the component generates the file without the extension "tmp". See the pictures:. 

 

 

0683p000009LtuE.png0683p000009LtpF.png0683p000009Ltfj.png

Sanjay5
Contributor III
Contributor III
Author

Hi,

 

It was working fine until i was running my job in windows but it is not working in Linux.

 

here is the explanation on the same:

Windows specifically does not accept filenames that end with a dot (.) or a space (" ").
You can even try it right now in your Windows UI/File explorer. If you try to rename a file with a dot or a space at the end, it will throw a warning asking you if you want to follow through with change and then promptly change the filename to a state without the dot or the space.

So when the job runs on Windows, the component/job server changes the filename to end with a dot and a space per the (" ") suffix, but then Windows promptly changes it back. Hence why you see filenames that look like they've been copied from the FTP.

 

Conclusion:

This trick is not really creating the file with exact same name.

 

Is there any other way, I can resolve the issue?