Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

Nifi: Execute script creating a locked text file

avatar
Explorer

Hi. I am trying to write a text file from execute script with python. Whenever the processor executes, it creates a locked text file. How can I overcome this problem?

Following is the code

from time import gmtime, strftime
import datetime

now = datetime.datetime.now()
current_time = now.strftime("%H:%M:%S")

with open('**path to directory**/time.txt', "a") as f:
current_time = str(current_time) + ('\n')
f.write(current_time)
f.close()

1 ACCEPTED SOLUTION

avatar
Explorer

Solved:

So, basically the problem was from Ubuntu side. The directory was under root privilege. Following command helped:

"sudo chmod a+rwx --path to directory--"

View solution in original post

1 REPLY 1

avatar
Explorer

Solved:

So, basically the problem was from Ubuntu side. The directory was under root privilege. Following command helped:

"sudo chmod a+rwx --path to directory--"