On May 15, 7:09 pm, Dave Angel wrote:
> Nathan Rice wrote:
> > This is precisely the situation mmap was made for :) It has almost the same
> > methods as a file so it should be an easy replacement.
>
> >
>
> Only on a 64bit system, and I'm not sure it's even possible there in
> every case. On a
On May 15, 7:09 pm, Dave Angel wrote:
> Nathan Rice wrote:
> > This is precisely the situation mmap was made for :) It has almost the same
> > methods as a file so it should be an easy replacement.
>
> >
>
> Only on a 64bit system, and I'm not sure it's even possible there in
> every case. On a
Nathan Rice wrote:
This is precisely the situation mmap was made for :) It has almost the same
methods as a file so it should be an easy replacement.
Only on a 64bit system, and I'm not sure it's even possible there in
every case. On a 32bit system, it would be impossible to mmap a 20gb
f
This is precisely the situation mmap was made for :) It has almost the same
methods as a file so it should be an easy replacement.
On Sat, May 15, 2010 at 10:05 AM, Nobody wrote:
> On Fri, 14 May 2010 18:38:55 -0400, J wrote:
>
> >>> someone smarter than me can correct me, but file.write() will
On Fri, 14 May 2010 18:38:55 -0400, J wrote:
>>> someone smarter than me can correct me, but file.write() will write when
>>> it's buffer is filled, or close() or flush() are called.
>>
>> And, in all probability, seek() will either flush it immediately or cause
>> the next write() to flush it bef
Thanks to y'all. I should have be more careful reading the documentation.
Cheers
On Fri, May 14, 2010 at 10:07 PM, Martin v. Loewis wrote:
>> The code works fine. I just don't know how f.write works. It says that
>> file.write won't write the file until file.close or file.flush.
>
> You are misi
On Fri, May 14, 2010 at 15:23, Nobody wrote:
> On Fri, 14 May 2010 10:50:49 -0400, J wrote:
>
>> someone smarter than me can correct me, but file.write() will write when
>> it's buffer is filled, or close() or flush() are called.
>
> And, in all probability, seek() will either flush it immediately
On Fri, 14 May 2010 10:50:49 -0400, J wrote:
> someone smarter than me can correct me, but file.write() will write when
> it's buffer is filled, or close() or flush() are called.
And, in all probability, seek() will either flush it immediately or cause
the next write() to flush it before writing
> The code works fine. I just don't know how f.write works. It says that
> file.write won't write the file until file.close or file.flush.
You are misinterpreting the documentation. It certainly won't keep the
entire file in memory. Instead, it has a fixed-size buffer (something
like 8kiB or 32kiB
On Fri, May 14, 2010 at 07:32, Jackie Lee wrote:
> Thx, Dave,
>
> The code works fine. I just don't know how f.write works. It says that
> file.write won't write the file until file.close or file.flush. So I
> don't know if the following one is more efficient (sorry I forget to
> add condition to
Thx, Dave,
The code works fine. I just don't know how f.write works. It says that
file.write won't write the file until file.close or file.flush. So I
don't know if the following one is more efficient (sorry I forget to
add condition to break the loop):
#! /usr/bin/env python
#coding=utf-8
import
Jackie Lee wrote:
Hello there,
I have a 22 GB binary file, a want to change values of specific
positions. Because of the volume of the file, I doubt my code a
efficient one:
#! /usr/bin/env python
#coding=utf-8
import sys
import struct
try:
f=open(sys.argv[1],'rb+')
except (IOError,Exc
Hello there,
I have a 22 GB binary file, a want to change values of specific
positions. Because of the volume of the file, I doubt my code a
efficient one:
#! /usr/bin/env python
#coding=utf-8
import sys
import struct
try:
f=open(sys.argv[1],'rb+')
except (IOError,Exception):
print '
13 matches
Mail list logo