<div dir="ltr">Hello folks, I am using Python-2.5.2 on fedora 9 sulphur -2.6.25-14.fc9.i686.I am creating a temporary file , in which data is written by another program and then i am using that temporary file to do my computations.I am new to linux and i am facing two issues<br>
<br>    homedir = os.path.expanduser('~')
<br>     
<br>    temp = tempfile.NamedTemporaryFile( suffix='_suffix',prefix='prefix_',dir= homedir)      
<br>     
<br>    temp.close()
<br> <br>    <br><br>    tn = <a href="http://temp.name">temp.name</a>
<br>     
<br>    print tn     
<br> <br>    Issue1 -> when i am logged in as root then everything works fine except that the file is created in the current working directory (/usr/Python-2.5.2) and not in the directory supplied as the dir='directory' parameter.i have tried dir='/tmp' as well.i don't know how to fix this issue and why the file is not getting created in the specified directory.<br>
<br><br><br>Issue2 -> when i am logged in as user ie any other user than root then i get  this error<br><br>sh: prefix_u92XQJ_suffix: Permission denied<br>also , i cannot find the find in either the current working directory nor in the dir='directory'.so i cant check the permission by using ls -l prefix_u92XQJ_suffix<br>
<br>Please help me understand this issue and eventually fix it.<br><br><br>Thanks<br><br>Aditya<br>  <br><br></div>