NO NO NO!!! For the sake of all that is holy don't do it!!!! Or rather, read & understand the fallacies of network programming: http://www.jezuk.co.uk/cgi-bin/view/jez?id=2650 before you do it. The failure mode of networks is quite different to that of files, and the programming model reflects that.
Two pieces of code someone really ought to write
31–36 of 36 posts
Re: Two pieces of code someone really ought to write
#32FWIW, Bash has this built in; cat It's unfortunately disabled in the bash that ships with debian, but should work pretty much everywhere else.
Re: Two pieces of code someone really ought to write
#33NO NO NO!!! For the sake of all that is holy don't do it!!!! Or rather, read & understand the fallacies of network programming: http://www.jezuk.co.uk/cgi-bin/view/jez?id=2650 before you do it. The failure mode of networks is quite different to that of files, and the programming model reflects that.
Actually, with a remote file system, the failure modes of networks is necessarily exactly the same as that of files.
Re: Two pieces of code someone really ought to write
#34NO NO NO!!! For the sake of all that is holy don't do it!!!! Or rather, read & understand the fallacies of network programming: http://www.jezuk.co.uk/cgi-bin/view/jez?id=2650 before you do it. The failure mode of networks is quite different to that of files, and the programming model reflects that.
What about files hosted over the network? Such as on a SAN?
Re: Two pieces of code someone really ought to write
#35NO NO NO!!! For the sake of all that is holy don't do it!!!! Or rather, read & understand the fallacies of network programming: http://www.jezuk.co.uk/cgi-bin/view/jez?id=2650 before you do it. The failure mode of networks is quite different to that of files, and the programming model reflects that.
> The failure mode of networks is quite different to that of files Actually, with a remote file system, the failure modes of networks is necessarily exactly the same as that of files.
If you drop that down a level and turn sockets into files then suddenly programs that are written to work with files will try to deal with these kind-of-file-but-not-really things, and fail in unexpected ways.
Re: Two pieces of code someone really ought to write
#36FWIW, Bash has this built in; cat It's unfortunately disabled in the bash that ships with debian, but should work pretty much everywhere else.
Is there anything similar in zsh? That could be quite helpful?
The zsh/net/tcp Module:
And zshtcpsys: