Prof. Pascal Felber, of the Institut d'informatique, Université de Neuchâtel, Switzerland, forwarded me this link to his uP2P file-sharing program - currently 6 lines totalling 436 bytes, implemented in sh with the networking done by netcat.
The nature of sh pretty much requires somewhat relaxing the "no external programs" limitation, and netcat is a fairly standard, commonly-available utility. As he points out, netcat is just at the TCP level, so it's probably within the rules I suggested for minimal-byte challenge programs. Using shell and invoking other programs does feel like it's edging close to triviality - why not just invoke ftp from the command line and have done with it? - but on the other hand, the coding is impressive. Any of these kinds of attempts ultimately come down to what kinds of ready-made pieces you can manage to connect to inside whatever arbitrary rules you make for yourself. He's gotten a lot of features into very few bytes.
It also seems to be more efficient than MoleSter, in that it'll only download the file once; that makes it more practical for actual use. I say "seems" because although I've read the code, I haven't fully understood it, even in the commented and documented version - I never became an expert shell programmer because I use Perl for that kind of task. I do have some concern about security, because the old "include metacharacters in input and make the variable substitutions misbehave" thing is very often a problem for shell scripts; but I don't know of any specific flaws of that nature in this code.
No comments yet.