- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Nifi: Execute script creating a locked text file
- Labels:
-
Apache NiFi
Created ‎09-22-2021 07:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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()
Created ‎09-23-2021 12:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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--"
Created ‎09-23-2021 12:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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--"
