Signatures seems to be correct, but J crashes with big files if we use
the SVN definitions without applying the long64to32 and long32to64
conversions.

Replacing the signature in the SetFilePointerDLLCALL and
GetFileSizeDLLCALL (of the code I wrote) makes no difference, the
SetFilePointerR and GetFileSizeR (as I defined them) still work:
   SetFilePointerDLLCALL=: >@{.@('kernel32 SetFilePointer i x x *x i'&(15!:0))
   GetFileSizeDLLCALL=: >@{.@('kernel32 GetFileSize i x *x'&(15!:0))


On Mon, Apr 14, 2008 at 12:16 PM, bill lam <[EMAIL PROTECTED]> wrote:
>
> Jorge Arredondo wrote:
>
> > Windows
> > cocurrent'jmf'
> > K32=: 2^32
> > K31=: 2^31
> > MAXLONG32=: <._1+K31
> >
> > long64to32=: 3 : 0
> >       y=. (2$K32)#:y
> >       ({.;(}.))|.<.((y>K31)*-K32)+y
> > )
> > long32to64=: <.@(K32&#.)@|:@(K32&|)@;@|.
> >
> > SetFilePointerDLLCALL=: >@{.@('kernel32 SetFilePointer i i i *i
> i'&(15!:0))
> > GetFileSizeDLLCALL=: >@{.@('kernel32 GetFileSize i i *i'&(15!:0))
> >
> > SetFilePointerR=: verb define
> >       'hFile lDistanceToMove lpDistanceToMoveHigh dwMoveMethod'=. y
> >       if. (lpDistanceToMoveHigh-:NULLPTR) *. (lDistanceToMove>MAXLONG32)
> do.
> >               'lDistanceToMove lpDistanceToMoveHigh'=. long64to32
> > lDistanceToMove
> >       end.
> >       SetFilePointerDLLCALL
> > hFile;lDistanceToMove;lpDistanceToMoveHigh;dwMoveMethod
> > )
> >
> > GetFileSizeR=: verb define
> >       hFile=. >{.y
> >       lpFileSizeHigh=. ,2
> >       lpFileSize=. GetFileSizeDLLCALL hFile;lpFileSizeHigh
> >       long32to64 lpFileSize,lpFileSizeHigh
> > )
> >
> >
>
>  Thank you. Could you also test if the GetFileSizeEx and SetFilePointerEx in
> the svn also works?
>
>  http://www.jsoftware.com/svn/base/trunk/api/mapped/init.ijs
>
>
>
>  regards,
>
>  ----------------------------------------------------------------------
>  For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to