Liste des Groupes | Revenir à col misc |
In article <lNycnZghasCXPtP6nZ2dnZfqnPSdnZ2d@earthlink.com>,I don't really know, but I would be surprised if that were always true.
"186282@ud0s4.net" <186283@ud0s4.net> writes:On 11/19/24 7:22 PM, Lawrence D'Oliveiro wrote:Named pipes can allow communication between unrelated processes.On Mon, 18 Nov 2024 01:20:53 -0500, 186282@ud0s4.net wrote:>
>Hey, if I feel the need to use files instead of 'pipes' then I WANT TO>
USE FILES INSTEAD OF PIPES.
Except ... you were trying to argue that there was no fundamental
difference between pipes and files anyway. That you could somehow do
everything you could do with pipes by using temporary files.
Yep.
>
But I *just may not WANT to* :-)
>
Files DO have a hidden advantage - many largely
dis-related programs can ACCESS them. This can
give you stats, insight, 'intelligence'. Pipes
are basically restricted to the original parent
and children. Good reasons for that, sometimes,
but not *always*.
Using files means there has to be locking or some coordination, so
that the receiver only reads the file when the contents are in a
consistent state.
Renaming a file (on the same filesystem, where it'sI suspect you are mixing up sensible programming techniques for handling file concurrency, with the way things need to be. i.e. I think it is perfectly possible to have concurrent programs read and write to the same file, it is just that there might be a few gotchas. Whereas renaming is a very safe and simple technique, avoiding many potential problems.
not a copy and delete) is atomic, so if the file is created in one
directory and moved to a parallel directory when complete, the
receiving program can just grab it from there, perhaps after being
signalled to wake up and scan the directory. That works somewhat
efficiently even without modern locking or filesystem change
notification mechanisms.
A file has the advantage that one can seek on it, which may simplify
some things; for example if a header has a checksum over the following
data, it's easier to seek back and fill that field in with its final
value. Otherwise one may have to use a temporary file internally anyway.
Les messages affichés proviennent d'usenet.