Hi Doug,

>> Yes. Unfortunately we couldn't solve the problem with fcntl(), even
>> under cygwin (don't know if the situation would be better today).

the posix functions are rather bad on windows.  It is better to use the
winapi functions directly.

I have ported iolib for Common Lisp to winapi and it works well so you
might get some ideas from
http://src.knowledgetools.de/tomas/winapi/index.html

Note that the latest code is in the winapi branch.

  $ git clone http://src.knowledgetools.de/tomas/winapi/iolib.git
  $ cd iolib
  $ git checkout winapi

then look in the src/winapi/ directory, particularly the winapi.lisp
file (contains ffi bindings for winapi).  Also the example1 function (in
example.lisp file) showing how to use WaitForMultipleObjects could be of
interest.

The backend-oio.lisp in src/multiplex/ directory can be interesting as
it implements read/write style io with timeouts.  (Though I'm not sure
whether timeouts are interesting for picolisp.)  There are also examples
with IO Completion Ports (async scalable io) but that is out of scope
for picolisp I think.

> Good question, maybe the newer Windows versions might support that
> better (file,record locking).

For locking, use LockFile or (asynchronous) LockFileEx.

>> But I'm afraid that there will be many other problems.  Especially
>> select(), fork() and pipe() issues come to mind.

There are several options for select depending on what kind of io you
are after.  In picolisp case, WaitForMultipleObjects or
WaitForSingleObjects might be enough (together with CreateEvent etc.).

Cheers,

Tomas
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to