From: Chris B. <chr...@ho...> - 2001-08-07 23:14:25
|
Robert Kern wrote: > Yeah, it took me some fiddling, too, before I got it to work. The Windows call > to mmap has slightly different semantics in that second argument, but I think > that if you want to snarf the whole file, then what I do below should work as > well. The Windows API lets you use 0 to default to the whole file, but that's > not portable. [code snipped] no, the "0 argument does not seem to work on Unix. It seems odd to not have a way to just snarf the whole file automatically, but so be it Thanks, that works, but now I am wondering: what I want is a fast and memory efficient way to get the contents of a fjile into a NujmPy array, this sure doesn't look any better than: a = fromstring(file.read())) thanks anyway, -Chris -- Christopher Barker, Ph.D. Chr...@ho... --- --- --- http://members.home.net/barkerlohmann ---@@ -----@@ -----@@ ------@@@ ------@@@ ------@@@ Oil Spill Modeling ------ @ ------ @ ------ @ Water Resources Engineering ------- --------- -------- Coastal and Fluvial Hydrodynamics -------------------------------------- ------------------------------------------------------------------------ |