I think your workaround which wraps 'fopen' seems is the best way for now.
Since Scheme port is not implemented with FILE* but fd returned by
open or something alike,
we can't convert directory from port to FILE*.
If there were port->fd procedure, you can covert fd with fdopen using FFI.
But since Mosh should support Windows,
port->fd may be too low level.
> David
You can post any feature requests to
http://code.google.com/p/mosh-scheme/issues/list.
> Yuki
How do you think about this problem?
Cheers.
Taro Minowa(Higepon)
> --
> You received this message because you are subscribed to the Google Groups "Mosh Developer Disscus" group.
> To post to this group, send email to mosh-develo...@googlegroups.com.
> To unsubscribe from this group, send email to mosh-developer-di...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mosh-developer-discuss?hl=en.
>
>
2010/12/28 higepon <hig...@gmail.com>:
- snip -
> If there were port->fd procedure, you can covert fd with fdopen using FFI.
> But since Mosh should support Windows,
> port->fd may be too low level.
- snip -
>> Yuki
>
> How do you think about this problem?
I have no objections to add port->fd into some platform specific library
(likely named (mosh ffi posix) or so.)
But there are some technical considerations when implement such procedure:
- How scheme-side port treated after port->fd?
- Allow textual-port?
- Allow standard ports(i.e. stdin/out/err)?
I think :
- port->fd should only allow "file backed" textual/binary port (ie.
other than standard or custom ports)
- scheme-side port should be closed after port->fd and require
explicit fd->port to re-gain scheme port access
> - How scheme-side port treated after port->fd?
Like on Gauche, fd should be dup-ped.
> - Allow textual-port?
No. Just binary-port only.
> - Allow standard ports(i.e. stdin/out/err)?
May be yes (works for only POSIX)
> - port->fd should only allow "file backed" textual/binary port (ie.
> other than standard or custom ports)
Yeah. Socket port can be supported.
Added to this feature request to Issues.
Cheers.