Re: Reading data from a file descriptor

2016-06-20 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Jun 20, 2016 at 12:40:53PM +0200, Andy Wingo wrote: > On Tue 17 Nov 2015 14:55, Chris Vine writes: > > > On Tue, 17 Nov 2015 13:52:21 +0100 > >> On Tue, Nov 17, 2015 at 12:59:56PM +, Chris Vine wrote: [...] > >> > guile's R6RS implement

Re: Reading data from a file descriptor

2016-06-20 Thread Andy Wingo
On Tue 17 Nov 2015 14:55, Chris Vine writes: > On Tue, 17 Nov 2015 13:52:21 +0100 >> On Tue, Nov 17, 2015 at 12:59:56PM +, Chris Vine wrote: >> > On Tue, 17 Nov 2015 10:53:19 +0100 >> >> [...] >> >> > guile's R6RS implementation has get-bytevector-some, which will do >> > that for you, wi

Re: Reading data from a file descriptor

2015-11-24 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Nov 23, 2015 at 10:07:11PM +0100, Andreas Rottmann wrote: > writes: [...] > > what Jan is after (and what I'd like to have too) is something > > akin to Unix read(2) with O_NONBLOCK: [...] > The procedure with the closest semantics is R6RS

Re: Reading data from a file descriptor

2015-11-23 Thread Andreas Rottmann
writes: > On Fri, Nov 13, 2015 at 10:51:58AM -0500, Mark H Weaver wrote: >> Jan Synáček writes: >> >> > On Sun, Nov 8, 2015 at 12:49 AM, Andreas Rottmann >> > wrote: >> > >> > Also note that if there's no requirement to actually implement >> > this in >> > C, there's `fdes->inport'

Re: Reading data from a file descriptor

2015-11-18 Thread Jan Synáček
On Tue, Nov 17, 2015 at 1:59 PM, Chris Vine wrote: > On Tue, 17 Nov 2015 10:53:19 +0100 > wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> On Mon, Nov 16, 2015 at 11:54:33AM +0100, Amirouche Boubekki wrote: >> > On 2015-11-13 21:41, Jan Synáček wrote: >> >> [...] >> >> > >I have a

Re: Reading data from a file descriptor

2015-11-17 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Tue, Nov 17, 2015 at 01:55:17PM +, Chris Vine wrote: > On Tue, 17 Nov 2015 13:52:21 +0100 > wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > On Tue, Nov 17, 2015 at 12:59:56PM +, Chris Vine wrote: > > > On Tue, 17 Nov 2

Re: Reading data from a file descriptor

2015-11-17 Thread Chris Vine
On Tue, 17 Nov 2015 13:52:21 +0100 wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On Tue, Nov 17, 2015 at 12:59:56PM +, Chris Vine wrote: > > On Tue, 17 Nov 2015 10:53:19 +0100 > > [...] > > > guile's R6RS implementation has get-bytevector-some, which will do > > that for yo

Re: Reading data from a file descriptor

2015-11-17 Thread Chris Vine
On Tue, 17 Nov 2015 10:53:19 +0100 wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On Mon, Nov 16, 2015 at 11:54:33AM +0100, Amirouche Boubekki wrote: > > On 2015-11-13 21:41, Jan Synáček wrote: > > [...] > > > >I have an open fd to a unix socket and I want to read data from > >

Re: Reading data from a file descriptor

2015-11-17 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, Nov 16, 2015 at 11:54:33AM +0100, Amirouche Boubekki wrote: > On 2015-11-13 21:41, Jan Synáček wrote: [...] > >I have an open fd to a unix socket and I want to read data from it. I > >know that the data is going to be only strings, but I don'

Re: Reading data from a file descriptor

2015-11-16 Thread Amirouche Boubekki
On 2015-11-13 21:41, Jan Synáček wrote: On Fri, Nov 13, 2015 at 4:51 PM, Mark H Weaver wrote: Jan Synáček writes: > On Sun, Nov 8, 2015 at 12:49 AM, Andreas Rottmann > wrote: > > Also note that if there's no requirement to actually implement > this in > C, there's `fdes->inport'

Re: Reading data from a file descriptor

2015-11-16 Thread tomas
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Fri, Nov 13, 2015 at 10:51:58AM -0500, Mark H Weaver wrote: > Jan Synáček writes: > > > On Sun, Nov 8, 2015 at 12:49 AM, Andreas Rottmann > > wrote: > > > > Also note that if there's no requirement to actually implement > > this in > >

Re: Reading data from a file descriptor

2015-11-15 Thread Thompson, David
On Sun, Nov 15, 2015 at 6:09 AM, Jan Synáček wrote: > On Fri, Nov 13, 2015 at 9:45 PM, Thompson, David > wrote: >> On Fri, Nov 13, 2015 at 3:41 PM, Jan Synáček wrote: >>> >>> I have an open fd to a unix socket and I want to read data from it. I >>> know that the data is going to be only strings,

Re: Reading data from a file descriptor

2015-11-15 Thread Jan Synáček
On Fri, Nov 13, 2015 at 9:45 PM, Thompson, David wrote: > On Fri, Nov 13, 2015 at 3:41 PM, Jan Synáček wrote: >> >> I have an open fd to a unix socket and I want to read data from it. I >> know that the data is going to be only strings, but I don't know the >> length in advance. The good thing ab

Re: Reading data from a file descriptor

2015-11-13 Thread Thompson, David
On Fri, Nov 13, 2015 at 3:41 PM, Jan Synáček wrote: > > I have an open fd to a unix socket and I want to read data from it. I > know that the data is going to be only strings, but I don't know the > length in advance. The good thing about using read-string!/partial is, > that I don't have to speci

Re: Reading data from a file descriptor

2015-11-13 Thread Jan Synáček
On Fri, Nov 13, 2015 at 4:51 PM, Mark H Weaver wrote: > > Jan Synáček writes: > > > On Sun, Nov 8, 2015 at 12:49 AM, Andreas Rottmann > > wrote: > > > > Also note that if there's no requirement to actually implement > > this in > > C, there's `fdes->inport' and `fdes->outport' on the

Re: Reading data from a file descriptor

2015-11-13 Thread Mark H Weaver
Jan Synáček writes: > On Sun, Nov 8, 2015 at 12:49 AM, Andreas Rottmann > wrote: > > Also note that if there's no requirement to actually implement > this in > C, there's `fdes->inport' and `fdes->outport' on the Scheme level, > so > something like the following would be anal

Re: Reading data from a file descriptor

2015-11-08 Thread Jan Synáček
On Sun, Nov 8, 2015 at 12:49 AM, Andreas Rottmann wrote: > Artyom Poptsov writes: > > > Oh sorry, there was a mistake in my previous mail. 'scm_i_fdes_to_port' > > is an internal procedure, but 'scm_fdes_to_port' is defined as Guile API > > and should be available to Guile programs. Here's its

Re: Reading data from a file descriptor

2015-11-07 Thread Andreas Rottmann
Artyom Poptsov writes: > Oh sorry, there was a mistake in my previous mail. 'scm_i_fdes_to_port' > is an internal procedure, but 'scm_fdes_to_port' is defined as Guile API > and should be available to Guile programs. Here's its definition: > > SCM > scm_fdes_to_port (int fdes, char *mode, SCM n

Re: Reading data from a file descriptor

2015-11-07 Thread Artyom Poptsov
Oh sorry, there was a mistake in my previous mail. 'scm_i_fdes_to_port' is an internal procedure, but 'scm_fdes_to_port' is defined as Guile API and should be available to Guile programs. Here's its definition: --8<---cut here---start->8--- SCM scm_fdes_to_por

Re: Reading data from a file descriptor

2015-11-07 Thread Artyom Poptsov
Hello Jan, do you need to read the data from the file descriptor in a Scheme program? If so, I guess you can make a wrapper procedure [1] that uses 'scm_fdes_to_port' from 'libguile.h' to convert your file descriptor to a SCM port and return the port into the Scheme world. Here's the description

Reading data from a file descriptor

2015-11-07 Thread Jan Synáček
Hello Guilers, how do I read data from a file descriptor? I already have an fd required from elsewhere that I need to read data from and actually have no idea how to do that. I read through the documentation on ports, but that didn't help. The fd actually points to a socket. In C, I have somethin