bill lam wrote:
On Wed, 03 Dec 2008, David Mitchell wrote:
Don,

A more correct answer:

Update to bigfiles.ijs
...
CreateFileW=: >@{.@('kernel32 CreateFileW i *w i i * i i i'&(15!:0))
...
u=: +./@(131072 2&=&(3!:0))
...
bfsize=: 3 : 0
if. u y do.
  try. fh=: CreateFileW ((7 u: y),{.a.);0;0;NULLPTR;OPEN_EXISTING;0;0 catch.

I guess it should be

   try. fh=: CreateFileW (([: u: 7 u: y),{.a.);0;0;NULLPTR;OPEN_EXISTING;0;0 
catch.
 or
   try. fh=: CreateFileW ((uucp y),{.a.);0;0;NULLPTR;OPEN_EXISTING;0;0 catch.

unless J will automatically coerce single byte data to wchar for *w
which I'm not sure.


   load 'C:\Users\DM\j602\system\packages\files\bigfilesw.ijs'
   load 'dir'
   bfsize_jbf_
+-+-+----------------------------------------------------------------------------+
|3|:|if. u y do.                                                                
 |
| | |  try. fh=: CreateFileW ((7 u: y),{.a.);0;0;NULLPTR;OPEN_EXISTING;0;0 
catch.|
...
   fdir 'help.htm'
+--------+------------------+---+---+------+
|help.htm|2007 12 7 13 56 58|371|rw-|-----a|
+--------+------------------+---+---+------+
   fdir 'ÿ'
+--+-----------------+---+---+------+
|ÿ|2008 12 2 14 7 57|300|rw-|-----a|
+--+-----------------+---+---+------+
   fdir '沒有問題'
+------------+------------------+-+---+------+
|沒有問題|2008 12 2 15 34 22|0|rw-|-----a|
+------------+------------------+-+---+------+
   bfsize_jbf_ 'help.htm'
0 371
   bfsize_jbf_ 'ÿ'
0 300
   bfsize_jbf_ '沒有問題'
0 0

--
David Mitchell
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to