[Tutor] Have any idea why I do not have access to MY files?
hcohen2
hcohen2 at comcast.net
Wed Jan 28 11:53:17 EST 2004
David Rock wrote:
>* hcohen2 <hcohen2 at comcast.net> [2004-01-28 11:03]:
>
>
>>These are excution functions: system() and popen(). For the same file
>>with the former I can see the contents:
>>
>>
>>
>>>>>result = os.system('cat new2text.py')
>>>>>
>>>>>
>>y = 0
>>print 'y is currently:', y
>>while y < 8:
>> y += 1
>> print 'incrementing y to: ', y
>>
>>whereas, if I try to read it - suddenly it does not belong to me!
>>
>>
>>
>>>>>f = os.popen('import2.py -a')
>>>>>sh: line 1: ./import2.py: Permission denied
>>>>>
>>>>>
>>But if I do this, its mine!
>>
>>
>>
>>>>>result = os.system('ls -l new2text.py')
>>>>>
>>>>>
>>-rw-r--r-- 1 prime_dev prime_dev 93 Jan 26 11:09 new2text.py
>>
>>Adding a full path has no effect, with popen() still claims I have no
>>rights.
>>
>>
>
>Maybe I'm not understanding something, but it doesn't look like you are
>trying to access the same file...
>
>
>
>>>>>result = os.system('cat new2text.py')
>>>>>f = os.popen('import2.py -a')
>>>>>
>>>>>
>
>Is it new2test.py or import2.py?
>
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Tutor maillist - Tutor at python.org
>http://mail.python.org/mailman/listinfo/tutor
>
>
David,
That was a typo - it fails when it is typed correctly. Giving myself
execute rights as was suggested to me and it has started to work.
Thanks,
Herschel
PS I usually try several attempts on a problem before I post a
question. You do not know how many times I have aborted a message due
to finding a solution.
More information about the Tutor
mailing list