Live data from Hacker News

Two pieces of code someone really ought to write

rondam.blogspot.com

31–36 of 36 posts

Re: Two pieces of code someone really ought to write

#31
post #29

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.

What about files hosted over the network? Such as on a SAN?

Re: Two pieces of code someone really ought to write

#33
post #29

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.

> 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.

Re: Two pieces of code someone really ought to write

#34
post #29

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.

What about files hosted over the network? Such as on a SAN?

What about them? Every last point on that list applies to them, by necessity, because they automatically apply to all networks.

Re: Two pieces of code someone really ought to write

#35
post #33
post #29

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.

> 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.

Yes, and you'll note that a huge amount of the remote file driver code involves dealing with those failures.

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

#36
post #32
post #14

FWIW, 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?

There are two much more powerful tcp interfaces built in to zsh:

The zsh/net/tcp Module:

http://tinyurl.com/3alarxf

And zshtcpsys:

http://tinyurl.com/32z6bwe

Post reply on HN