My goal is very simple. Have a mechanism to create sparse files and modify them by writing arbitratry ranges of bytes at arbitrary offsets. I did get the information I want (xrange instead of range, and a simple way to generate 1Mb string in memory). Thanks for pointing out about using "len" as variable. It is indeed silly.
My only assumption from underlying OS/file system is that if I seek past end of file and write some data, it doesn't generate blocks for data in between. This is indeed true on Linux (I tested on ext3). Thanks, Raghu. -- http://mail.python.org/mailman/listinfo/python-list