Reputation: 4235
I am using python and invoking external utility "send-data" in my .py file as shown below,
cmd=['send-data', '-f', file_name]
res = subprocess.run(cmd,stdout=subprocess.PIPE, input=b'a')
I have no control over send-data utility and it creates file under /tmp directory with random name as shown below in the response string.
'a)bort, e)dit or s)end? send-data: the file remains in /tmp/pbadLWX .'
Wondering how can i delete the file "pbadLWX" under /tmp folder after each execution? Considering every time file name could be different?
Upvotes: 0
Views: 743