Steve Hay wrote: >Test number 4 of this simple test program is failing under Perl built >with bcc32. > >Editing the test program to output $pos and $word after test 4 I have: > >pos='4.80611380632328e+18', word='' > >It seems that Search::Dict::look gets a very strange answer when it >queries the size of the file. I tried closing the file and then >reopening it in Search/Dict.t, but that doesn't help. Perl built with >bcc32 apparently just can't get the size of an open file: > >C:\p5p\bleadperl>\cygwin\bin\od -c foo >0000000 f o o \r \n >0000005 >C:\p5p\bleadperl>perl -e "print +(stat('foo'))[7]" >5 >C:\p5p\bleadperl>perl -e "open F, 'foo'; print +(stat(F))[7]" >4.80611889585953e+18 > >In fact, size is not the only part of stat() that doesn't work on a >filehandle: > >C:\p5p\bleadperl>perl -e "print join ', ', stat('foo')" >2, 0, 4294934966, 1, 0, 0, 2, 5, 1119011754, 1119011754, 1119011754, , >C:\p5p\bleadperl>perl -e "open F, 'foo'; print join ', ', stat(F)" >0, 0, 4294934966, 1, 0, 0, 0, 4.80611902041358e+18, 1119011754, >1119011754, 0, , > >At the C level, fstat() works fine, though, so it must be something that >Perl is doing :( > >I see some BORLANDC-specific stuff in win32_stat(), but it is only >playing with st_mode, so I don't know what's going wrong here. > Looks like it is large file support that is the problem here.
Perl is built with USE_LARGE_FILES enabled by default on Win32. Rebuilding perl with bcc32 with USE_LARGE_FILES disabled all the tests (except lib/Test/Simple/t/fail-more.t test 10, which is a separate issue that I'll comment on in another thread) now pass, and stat() behaves itself on filehandles! Does anyone know why it might be that LFS doesn't work (even on "small" files) with bcc32? Support seems to have been added only fairly recently (change 21989). Maybe it has never worked properly. If I can't find an answer then I'll just document the known failures in README.win32 for now. ------------------------------------------------ Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.