Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Karuetl
Creator II
Creator II

Create folder in FTP location

Need help if the folder doesn't exist in the FTP location then create a folder else if exists then drop files into that folder

 

Please help me out 

Labels (2)
10 Replies
vapukov
Master II
Master II

Karuetl
Creator II
Creator II
Author

This checks file exists but I am looking for file directory not file 

vapukov
Master II
Master II

sure? 🙂

 

0683p000009M1wJ.png

Karuetl
Creator II
Creator II
Author

I am using Talend 6.2 , hence it doesn't have such option

Karuetl
Creator II
Creator II
Author

Can you guide me how to execute below commands in tSSH

 

cd dirname

if [ ! -d "$dirname" ]
then    echo "File doesn't exist. Creating now"    mkdir ./$dirname
    echo "File created"
else    echo "File exists"
fi

 

akumar2301
Specialist II
Specialist II

mkdir -p {directoryName}
this will create directory only if does not exists.

using tSSH

https://community.talend.com/t5/Design-and-Development/resolved-Using-tSCPPut-component/td-p/108006
Karuetl
Creator II
Creator II
Author

I tried below but code compilation error

 

0683p000009M1rZ.png

akumar2301
Specialist II
Specialist II

No need to put cd and then mkdir

“mkdir -p folder/“ + context.Year should be enough.

I guess error is because “” are missing.
vapukov
Master II
Master II


@uganesh wrote:

I guess error is because “” are missing.

yes, double quotes around commands missed, must be 

"cd folder" or "mkdir -p folder/"+context.YEAR