On 12/20/2019 6:59 PM, Matthew Flatt wrote:
> At Fri, 20 Dec 2019 23:39:30 +0300, Dmitry Pavlov wrote:
> > > The Racket-imposed limit should be 64 bits (more than enough) on all
> > > platforms. I can try to replicate the problem later today, but more
> > > information on the error message would be helpful.
> >
> > I do not have access to that Windows 7 machine until Monday.
> > I managed to reproduce the problem, though, on a 32-bit Windows XP with
> > Racket 7.1.
> >
> > file-position: new position is too large
> > port: #<input-port:E:\path\to\my\file>
> > position: 1122398240
>
> I'm not able to replicate the error on a fresh(!) 32-bit Windows 7
> installation using v7.1 or v7.5. I also don't think it should happen
> based on the implementation. So, I'm missing something.
I tried with 32-bit 7.3, but I also could not create a ~1GB file
position size error.
One strange thing I did notice though:
My 32-bit Racket happens to be on a 64-bit Win10 host. I dashed off the
little test program below, then compiled it to a (13MB) distribution
executable for the 32-bit Win7 machine (which does not have Racket
available). When I tried it, I was quite surprised that it took over a
minute to run. I deleted the data file and ran it again, this time
monitoring the file size in Explorer. The file began small and steadily
increased in size until the program ended. Being curious, I then tried
the executable on the 64-bit Win10 machine and got the similar results -
it ran faster, but still took much longer than I expected.
Is Racket really writing billions of zeroes rather than creating a
sparse file? It seems to me that this file should only create 2 actual
data blocks, and (modulo JIT) the program should finish almost
instantly. What am I missing?
George
-----------------------------------------------------
#lang racket
(define (fout) (current-output-port))
(with-output-to-file "test.dat"
(lambda ()
(write "hello")
(file-position (fout) (* 3 1024 1024 1024))
(write "there")
)
#:mode 'binary
#:exists 'can-update
)