Deutsch English Français Italiano |
<JJOdnfSeXoej5aT6nZ2dnZfqnPSdnZ2d@earthlink.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!Xl.tags.giganews.com!local-3.nntp.ord.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail NNTP-Posting-Date: Sun, 17 Nov 2024 04:59:41 +0000 Subject: Re: The joy of pipes Newsgroups: comp.os.linux.misc References: <vgns2aqlhq@dont-email.me> <20241112111426.00007245@gmail.com> <e44df1bda1f1622a8d725c69860d3225@msgid.frell.theremailer.net> <m2ttc9y3d8.queerchen@cmschueller.my-fqdn.de> <eli$2411141855@qaz.wtf> <20241114160907.0000252b@gmail.com> <vh6a9k$33c17$5@dont-email.me> <hzSdnTUBKbG_YKv6nZ2dnZfqnPQAAAAA@earthlink.com> <A7GZO.66$hgYd.23@fx41.iad> <wwvr07bpizm.fsf@LkoBDZeT.terraraq.uk> From: "186282@ud0s4.net" <186283@ud0s4.net> Organization: wokiesux Date: Sat, 16 Nov 2024 23:59:41 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <wwvr07bpizm.fsf@LkoBDZeT.terraraq.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Message-ID: <JJOdnfSeXoej5aT6nZ2dnZfqnPSdnZ2d@earthlink.com> Lines: 62 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 99.101.150.97 X-Trace: sv3-cc67S2QY3uxMTAaGkQnHG2B0x9U4XJFEgaJVMHptduezd+K9xqA8JAtSaluOOBqvofEYtm77FS7aL7+!pA8Exxv2jGcmcrnXaS5uqSOPwJvRBihiZezprX6IDqD9UMzfzrxkbH9Ew8RbZzH7s2kogyRgHQeo!4kCqxt9ddJHZnzjTXROC X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 Bytes: 4141 On 11/16/24 5:31 AM, Richard Kettlewell wrote: > Louis Krupp <lkrupp@invalid.pssw.com.invalid> writes: >> On 11/15/2024 12:49 AM, 186282@ud0s4.net wrote: >> >> On 11/14/24 9:05 PM, Lawrence D'Oliveiro wrote: >> >> On Thu, 14 Nov 2024 16:09:07 -0800, John Ames wrote: >> >> (I think it was a topic shift to applications of *nix pipes...?) >> >> Oh shelly boy, the pipes, the pipes are calling ... >> >> Pipes are good. >> >> But, really, they're just temp files the parent >> process can access. >> >> Pipes *could* be implemented with temporary disk files, at least to an >> extent, but as far as I can tell, they're not. > > “Temporary files the parent can access” is not a good model for a couple > of reasons: > > * The semantics are different. Bytes read from a regular file are still > there to be read again if you rewind the file; bytes read from a pipe > are gone. Empty/full files behave differently to empty/full pipes. > > * Temporary regular files can already be accessed by other processes by > name, by file descriptor inheritance, or file descriptor passing. Didn't say temp disk files were necessarily SUPERIOR, just that they CAN do most of the stuff pipes are used for and in an easier user/code-friendly fashion. SIZE is almost unlimited too. Anyway, I'd made some TCP/UDP servers but the parent needed to know the status of the children in a little more detail than just a tiny return code - might want to terminate the child if it'd been idle for awhile, might want to know how much bandwidth was being used, might want to pick a good time to do some maint routines, might want to know WHO the connections were from. Pipes were the (relatively) easy 'C'-approved method and did the job very well. So, for most, use pipes. Python and FPC also do pipes. They're INTENDED for inter-process communications after all so generally GO that way. The Bi-Di server was the most fun ... think a "chat" app but with the potential for more than just text - closer to 'remote terminal'/SSH. ALMOST slipped into re-creating an FTP app until I realized where it was going. Too much enthusiasm. Commented-out the remote root system call function :-) Amazing how LITTLE code is required for such things. Even the pre-threaded version (max cap) wasn't huge at all (albeit the hardest to 'hold in yer head' as to how it worked). Base examples in several langs easily found on the net - just build-on as necessary and then party on.