is it possible that ipython is not actually closing the file but keeping
the file descriptor open behind your back, if so then seeking to 0 might
solve it?



On Wed, Aug 29, 2012 at 1:00 AM, Tom Kuiper <[email protected]> wrote:

> On 08/28/2012 03:54 PM, David MacMahon wrote:
>
>> On Aug 28, 2012, at 3:39 PM, Tom Kuiper wrote:
>>
>>
>>> I don't know how to get Python to read more than teh nominal file size
>>> if it is supposed to look like a file.
>>>
>>>
>> If you want to read the register value a second time, you need to seek to
>> the beginning of the file first, then read four bytes.  You should be able
>> to repeat the seek/read pattern as many times as you want.
>>
>>
> I close the file after I write to it and open it again for the read.
>  After I write to the file, "ls -l" gives a size of zero instead of 4.
>
>  If that's not what's confusing you, can you please clarify what is?
>>
> I am not trying to mix reads and writes on an open file.  I know about
> seek and tell if that were what I wanted to do.
>
> Tom
>
>


-- 
*Adam Barta*
c: +27 72 105 8611
e: [email protected]
w: www.ska.ac.za

Reply via email to