Steve McAffer
Steve McAffer

Reputation: 385

Does the saveAsTextFile create the directories?

Does saveAsTextFile create the directories, if I am saving a text file and directory or path on a Linux machine does not exist? Would the below Scala code create the test1 directory if it is not there?

rdd.saveAsTextFile ("file:///test1/textfile.txt");

Upvotes: 0

Views: 622

Answers (1)

Tzach Zohar
Tzach Zohar

Reputation: 37852

Well, yes - as a quick test of the code you pasted shows. Of course, the user must have the necessary permissions to create the directory.

Upvotes: 1

Related Questions