4 ms·
Try and add support for detecting piped input on the server side: bcp < filename because this would allow for things like cat filename | gzip | bcp with
by latitude 14y ago
Try and add support for detecting piped input on the server side:
bcp < filename
because this would allow for things like
cat filename | gzip | bcp
with the receiving end doing
bcp | gunzip > filename
Keep it as simple as it is now, but make it play nicely with other tools.
- lutusp 14y agoYour examples are all expected to sort out whether to accept an input stream or start an output stream, but without an explicit command, which poses a problem -- the app would have to determine that the input stream is empty before switching modes to streaming output. That's not so easy -- suppose the operator unintentionally pipes an empty input file? Will the app know what to do? Most (I won't say all) command-line apps must be explicitly told which mode to use. There's a good reason.
- huhtenberg 14y agoisatty() to the rescue, but that's not to say that there shouldn't be a -- option or defaulting to a different mode depending on argv[0], like gzip does. [0] http://pubs.opengroup.org/onlinepubs/007904875/functions/isatty.html http://pubs.opengroup.org/onlinepubs/007904875/functions/isa...
- diginux 14y agoThis would be a great addition, I will add it as an issue, thanks!