Article View: news.software.readers
Article #85144Re: [slrn][s-lang] Redirecting Output from an external Program into an array
From: Jurriaan (note: this is a workin...
Date: Fri, 05 Oct 2001 04:55
Date: Fri, 05 Oct 2001 04:55
24 lines
1931 bytes
1931 bytes
On 04 Oct 2001 21:34:43 GMT, John E. Davis
<davis@space.mit.edu> wrote:
> On 4 Oct 2001 16:49:58 GMT, Tilman Linneweh <tilman+0105@arved.de>
>>Ist there a possibility to get the output of a command, eg. ls into an
>>array?
>
> You can use the popen function. If you want a list of files in a
> directory, use the listdir function.
>
Someone pointed this out to me, once:
xface_fp = popen ("cat /home/jurriaan/News/hdr_xface | view-x-face", "r");
if (xface_fp == NULL) return;
popup_window ("X-Face:", strjoin (fgetslines(xface_fp), ""));
() = pclose (xface_fp);
very elegant, I'm still impressed.
Good luck,
Jurriaan
--
Eat shit -- billions of flies can't be wrong.
GNU/Linux 2.4.9-ac18 SMP/ReiserFS 2x1402 bogomips load av: 0.63 0.14 0.05
Technical Details
Message-ID:
<slrn9rqet7.42n.no_spam_here@middle.of.nowhere>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!transit.news.xs4all.nl!not-for-mailReferences:
<slrn9rp4rf.2ol0.tilman+0105@tl.kom.tuwien.ac.at> <slrn9rplfi.bp2.davis@aluche.mit.edu>Show Full Headers
Complete Article Headers
Message-ID: <slrn9rqet7.42n.no_spam_here@middle.of.nowhere> Subject: Re: [slrn][s-lang] Redirecting Output from an external Program into an array Date: Fri, 05 Oct 2001 04:55:40 +0000 From: "Jurriaan (note: this is a working address!)" <no_spam_here@rivierenland.xs4all.nl> References: <slrn9rp4rf.2ol0.tilman+0105@tl.kom.tuwien.ac.at> <slrn9rplfi.bp2.davis@aluche.mit.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!transit.news.xs4all.nl!not-for-mail Newsgroups: news.software.readers Organization: XS4ALL Internet BV Lines: 23 NNTP-Posting-Host: rivierenland.xs4all.nl X-Trace: news1.xs4all.nl 1002257740 4362 194.109.14.47 (5 Oct 2001 04:55:40 GMT) X-Complaints-To: abuse@xs4all.nl NNTP-Posting-Date: 5 Oct 2001 04:55:40 GMT X-Face: b$-F+98,@$_I=*ODq'<K2(OA)qC&,(GP=z2^`4dwQwy&e;!|R?>")k9FH3?YC+%*kF\=<Rx"Hy2_eyMtnFSiO8 User-Agent: slrn/0.9.7.2-jwk (Linux)