search for: readln

Displaying 14 results from an estimated 14 matches for "readln".

Did you mean: readl
2006 Dec 29
2
Binary AGI Scripts
...ctionality than what is available such as having the AGI determine if the "data" argument is plain text or a path to a text file and act accordingly. The problem that I'm having is that Asterisk is not sending back any responses to commands. I'm using stdin/stdout through the ReadLn and WriteLn commands in freepascal. Reading in the initial env variables is no problem, but once I issue a command like so: // >>> Create wav file from swift here <<< WriteLn('EXEC PLAYBACK /tmp/NewlyCreatedFile'); ReadLn(StringVar); // <========= Never returns...
2001 Oct 02
1
problem with while loop with next (was RE: file connection, w hile, readLines and browser)
...Prof. Gentleman (and R-help), > > Here's an example of what didn't work. I still don't understand why. > > Function: > trycon <- function(file, n) { > f.con <- file(file, open="rt") > on.exit(close(f.con)) > i <- 0 > while( length(readln <- readLines(f.con, 1)) > 0 ) { > x <- unlist(strsplit(readln, " ")) > if(length(x) <= 6 && x[3] == x[4]) next > i <- i + 1 > } > return(invisible()) > } > > Data file: > 1 0.00 ABC ABC 1.00 0 > 2 0.00 DEF DEF 1.00 0 C...
2001 Oct 02
0
An example (was RE: file connection, while, readLines and bro wser)
Prof. Gentleman (and R-help), Here's an example of what didn't work. I still don't understand why. Function: trycon <- function(file, n) { f.con <- file(file, open="rt") on.exit(close(f.con)) i <- 0 while( length(readln <- readLines(f.con, 1)) > 0 ) { x <- unlist(strsplit(readln, " ")) if(length(x) <= 6 && x[3] == x[4]) next i <- i + 1 } return(invisible()) } Data file: 1 0.00 ABC ABC 1.00 0 2 0.00 DEF DEF 1.00 0 CDE 1.00 0 XYZ 0.72 0 3 0.00 abc abc 1.00 0 ghi 1....
2001 Oct 02
1
RE: problem with while loop with next
...#39;t work. I still don't > understand why. > > > > > > Function: > > > trycon <- function(file, n) { > > > f.con <- file(file, open="rt") > > > on.exit(close(f.con)) > > > i <- 0 > > > while( length(readln <- readLines(f.con, 1)) > 0 ) { > > > x <- unlist(strsplit(readln, " ")) > > > if(length(x) <= 6 && x[3] == x[4]) next > > > i <- i + 1 > > > } > > > return(invisible()) > > > } > > > &g...
2001 Oct 02
0
file connection, while, readLines and browser
...minor 3.1 year 2001 month 08 day 31 language R I defined a function like the following: myfun <- function(file, maxline) { f.con <- file(file, open="rt") on.exit(close(f.con)) while(length(readln <- readLines(f.con, 1)) > 0 ) { ## Do something with readln... } ## Do something more... } This didn't work for me. It gave me an error at the while statement, saying "NA where logical needed". I inserted a browser() right inside the while loop and have it step throug...
2009 Oct 13
1
Iterating over file lines
...ne by line. In my function below, I am only getting the first item over and over and over again from my test file rather than subsequent lines. How can I modify this to read lines sequentially? == iteratefile <- function(file) { f.con <- file(file) on.exit(close(f.con)) while( length(readln <- readLines(f.con, 1)) > 0 ) { x <- unlist(strsplit(readln, " ")) print(x[1]) } return(invisible()) } iteratefile("test.txt") == I am working with version 2.9.2 on Mac OS X 10.5. My code is based on examples I've taken from the mailing list, and...
2002 Jun 15
2
Late Make Problem with Readline (PR#1673)
Full_Name: Jeremy Fox Version: 1.5.0 OS: Solaris 8, 64 bit Submission from: (NULL) (171.64.232.63) I am compiling R under Solaris and the compilation stops at this point. The problem only happens when I link in readline. The R binary is actually compiled and readlne works. The main problem with the compiled binary (other than that all the supporting files were not correctly installed) is that it prints out the error Warning message: There is no package called `ctest' in: library(package, char = TRUE, logical = TRUE, warn.conflicts = warn.conflicts,...
2004 Apr 28
1
(no subject)
hi new user here cant seem to get fwd running, got asterisk from download site as tarball, did the readln and openssl start. Also configured the sip.conf and extensions.conf but an error with the chan_sip.c shows up? any ideas...somebody...anybody! thanx jai
2004 Apr 28
2
chan_sip.c bad file descriptor error??
hi new user here cant seem to get fwd running, got asterisk from download site as tarball, did the readln and openssl start. Also configured the sip.conf and extensions.conf but an error with the chan_sip.c shows up? any ideas...somebody...anybody! thanx jai
2007 Feb 18
5
Looking for starting point?
Hi, I am a retired telephone tech/manager who recently had a bad experience with a local company offering digital phone service (VoIP). I have spent the last thirty years in the PSTN network, switching, PBX and key system field and am interested in learning more about VoIP. My background also includes programming, mostly specialized applications to interact with the PSTN network. Most of my
2009 Mar 05
0
[PATCH 5/5] COM32/rosh: Improvements
...39;); - if (bufeol == NULL) { + for (i = 0; i < numln; i++) { + bufeol2 = strchr(bufeol, '\n'); + if (bufeol2 == NULL) { bufeol = buf + buflen; i = numln; } else { - bufeol++; + i += ((bufeol2 - bufeol)/cols); + bufeol = bufeol2 + 1; } -// printf("--readln\n"); } bufcnt = bufeol - bufp; -printf("--(%d/%d @%d)\n", bufcnt, buflen, bufpos); + printf("--(%d/%d @%d)\n", bufcnt, buflen, bufpos); memcpy(scrbuf, bufp, bufcnt); scrbuf[bufcnt] = 0; printf("%s", scrbuf); bufp = bufeol; bufpos += bufcnt; -...
2009 Feb 15
2
COM32 module: Read-Only shell
...t;, ECHO); +// printf("=%08X", ); +// printf("\n"); + while (bufpos < buflen) { + for (i=0; i<numln; i++){ + bufeol = strchr(bufeol, '\n'); + if (bufeol == NULL) { + bufeol = buf + buflen; + i = numln; + } else { + bufeol++; + } +// printf("--readln\n"); + } + bufcnt = bufeol - bufp; +printf("--(%d/%d @%d)\n", bufcnt, buflen, bufpos); + memcpy(scrbuf, bufp, bufcnt); + scrbuf[bufcnt] = 0; + printf("%s", scrbuf); + bufp = bufeol; + bufpos += bufcnt; + if (bufpos == buflen) break; + inc = rosh_getkey(); + numln...
2010 Jun 27
1
[PATCH] ROSH: Upgraded
...bufeol = strchr(bufeol, '\n'); - if (bufeol == NULL) { + bufeol2 = strchr(bufeol, '\n'); + if (bufeol2 == NULL) { bufeol = buf + buflen; i = numln; } else { - bufeol++; + i += ((bufeol2 - bufeol) / cols); + bufeol = bufeol2 + 1; } -// printf("--readln\n"); } bufcnt = bufeol - bufp; printf("--(%d/%d @%d)\n", bufcnt, buflen, bufpos); @@ -557,12 +822,8 @@ void rosh_more_buf(char *buf, int buflen, int rows, int cols) break; case ' ': numln = rows - 1; -// default: } } -/*tcgetattr(0, &am...
2013 Jun 30
18
Xen 4.2.2 /etc/init.d/xendomains save and restore of domains does not work
Hello, in the last days I switched from Xen 4.2.1 to Xen 4.2.2 (source from git repository tag 4.2.2) commit a125ec6a4a2f028f97f0bdd8946d347a36dbe76b Author: Jan Beulich <jbeulich@suse.com> Date: Tue Apr 23 18:42:55 2013 +0200 update Xen version to 4.2.2 My "base system" is a debian squeeze. For Xen I use the xl toolstack. Since updating to 4.2.2 the autosave and