From: Nicholas Clark Date: 11:39 on 28 Jan 2008 Subject: pdftotext SYNOPSIS pdftotext [options] [PDF-file [text-file]] ... Pdftotext reads the PDF file, PDF-file, and writes a text file, text- file. If text-file is not specified, pdftotext converts file.pdf to file.txt. If text-file is '-', the text is sent to stdout. No. Dammit. You're a Unix filter command. You should ALWAYS be writing to stdout. Anything else would be hateful and broken and counterintuitive. Nicholas Clark
From: Peter da Silva Date: 15:45 on 28 Jan 2008 Subject: Re: pdftotext On 2008-01-28, at 05:39, Nicholas Clark wrote: > You're a Unix filter command. You should ALWAYS be writing to stdout. And reading from stdin. > Anything else would be hateful and broken and counterintuitive. The worst I've seen is a command that demanded a "-o" option with the file name for output, and wouldn't run without it.
From: Abigail Date: 15:57 on 28 Jan 2008 Subject: Re: pdftotext --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 28, 2008 at 09:45:58AM -0600, Peter da Silva wrote: > On 2008-01-28, at 05:39, Nicholas Clark wrote: > >You're a Unix filter command. You should ALWAYS be writing to stdout. >=20 > And reading from stdin. I think pdftotext isn't even able to read from stdin: $ pdftotext ... usage message ... $ pdftotext - Error: Couldn't open file '-' $ It special cases '-' if it's the name of the output file, but it doesn't=20 do anything special with '-' as the input file. Abigail --bg08WKrSYDhXBjb5 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFHnftMBOh7Ggo6rasRAhInAJwOKykY/nvsrlI50WynWFHqd8VZHgCgqJZz JUBeoUg2W4davPdJeStj57c= =OLCH -----END PGP SIGNATURE----- --bg08WKrSYDhXBjb5--
From: ilmari (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) Date: 16:17 on 28 Jan 2008 Subject: Re: pdftotext Abigail <abigail@xxxxxxx.xx> writes: > On Mon, Jan 28, 2008 at 09:45:58AM -0600, Peter da Silva wrote: >> On 2008-01-28, at 05:39, Nicholas Clark wrote: >> >You're a Unix filter command. You should ALWAYS be writing to stdout. >> >> And reading from stdin. > > I think pdftotext isn't even able to read from stdin: > > $ pdftotext > ... usage message ... > $ pdftotext - > Error: Couldn't open file '-' > $ > > It special cases '-' if it's the name of the output file, but it doesn't > do anything special with '-' as the input file. This is the kind of hatefulness /dev/stdin is perfect for alleviating. Except of course if the app insists on mmapping or seeking in the file, which doesn't work on pipes. Luckily pdftotext doesn't seem to partake of that particular hatefulness.
From: H.Merijn Brand Date: 16:30 on 28 Jan 2008 Subject: Re: pdftotext On Mon, 28 Jan 2008 16:17:01 +0000, ilmari@xxxxxx.xxx (Dagfinn Ilmari Manns=C3=A5ker) wrote: > Abigail <abigail@xxxxxxx.xx> writes: >=20 > > On Mon, Jan 28, 2008 at 09:45:58AM -0600, Peter da Silva wrote: > >> On 2008-01-28, at 05:39, Nicholas Clark wrote: > >> >You're a Unix filter command. You should ALWAYS be writing to stdout. > >>=20 > >> And reading from stdin. > > > > I think pdftotext isn't even able to read from stdin: > > > > $ pdftotext > > ... usage message ... > > $ pdftotext - > > Error: Couldn't open file '-' > > $ > > > > It special cases '-' if it's the name of the output file, but it doesn'= t=20 > > do anything special with '-' as the input file. >=20 > This is the kind of hatefulness /dev/stdin Do not start new hate on that :) % ls -al /dev/std* ls: /dev/std*: No such file or directory We're not all on Linux. > is perfect for alleviating. > Except of course if the app insists on mmapping or seeking in the file, > which doesn't work on pipes. Luckily pdftotext doesn't seem to partake > of that particular hatefulness. --=20 H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using & porting perl 5.6.2, 5.8.x, 5.10.x on HP-UX 10.20, 11.00, 11.11, & 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin. http://qa.perl.org http://mirrors.develooper.com/hpux/ http://www.test-smoke.org http://www.goldmark.org/jeff/stupid-disclaimers/
From: Nicholas Clark Date: 16:35 on 28 Jan 2008 Subject: Re: pdftotext On Mon, Jan 28, 2008 at 05:30:26PM +0100, H.Merijn Brand wrote: > On Mon, 28 Jan 2008 16:17:01 +0000, ilmari@xxxxxx.xxx (Dagfinn Ilmari > Mannsåker) wrote: > > This is the kind of hatefulness /dev/stdin > > Do not start new hate on that :) > > % ls -al /dev/std* > ls: /dev/std*: No such file or directory > > We're not all on Linux. $ ls -l /dev/stdin lrwxr-xr-x 1 root wheel 4 Jan 1 1970 /dev/stdin -> fd/0 $ uname FreeBSD True. We're not. Nicholas Clark
From: Patrick Quinn-Graham Date: 16:46 on 28 Jan 2008 Subject: Re: pdftotext On 28-Jan-08, at 4:35 PM, Nicholas Clark wrote: > On Mon, Jan 28, 2008 at 05:30:26PM +0100, H.Merijn Brand wrote: >> On Mon, 28 Jan 2008 16:17:01 +0000, ilmari@xxxxxx.xxx (Dagfinn Ilmari >> Manns=E5ker) wrote: > >>> This is the kind of hatefulness /dev/stdin >> >> Do not start new hate on that :) >> >> % ls -al /dev/std* >> ls: /dev/std*: No such file or directory >> >> We're not all on Linux. > > $ ls -l /dev/stdin > lrwxr-xr-x 1 root wheel 4 Jan 1 1970 /dev/stdin -> fd/0 > $ uname > FreeBSD > > True. We're not. > > Nicholas Clark > Felicity:~ patrick$ ls -l /dev/stdin lr--r--r-- 1 root wheel 4 15 Jan 20:12 /dev/stdin -> fd/0 Felicity:~ patrick$ uname Darwin Indeed, we're not all on linux. We could be if we wanted to though: patrick@dave:~$ ls -l /dev/stdin lrwxrwxrwx 1 root root 15 2007-11-30 14:06 /dev/stdin -> /proc/self/fd/0 patrick@dave:~$ uname Linux Patrick Quinn-Graham - +44 78 7217 2213 - http://about.patrick.geek.nz Don't you feel more like you do now than you did when you came in? -- /usr/games/fortune
From: H.Merijn Brand Date: 16:59 on 28 Jan 2008 Subject: Re: pdftotext On Mon, 28 Jan 2008 16:46:21 +0000, Patrick Quinn-Graham <pftqg@xxx.xxx> wrote: > On 28-Jan-08, at 4:35 PM, Nicholas Clark wrote: >=20 > > On Mon, Jan 28, 2008 at 05:30:26PM +0100, H.Merijn Brand wrote: > >> On Mon, 28 Jan 2008 16:17:01 +0000, ilmari@xxxxxx.xxx (Dagfinn Ilmari > >> Manns=C3=A5ker) wrote: > > > >>> This is the kind of hatefulness /dev/stdin > >> > >> Do not start new hate on that :) > >> > >> % ls -al /dev/std* > >> ls: /dev/std*: No such file or directory > >> > >> We're not all on Linux. > > > > $ ls -l /dev/stdin > > lrwxr-xr-x 1 root wheel 4 Jan 1 1970 /dev/stdin -> fd/0 > > $ uname > > FreeBSD > > > > True. We're not. > > > > Nicholas Clark > > >=20 > Felicity:~ patrick$ ls -l /dev/stdin > lr--r--r-- 1 root wheel 4 15 Jan 20:12 /dev/stdin -> fd/0 > Felicity:~ patrick$ uname > Darwin >=20 > Indeed, we're not all on linux. We could be if we wanted to though: >=20 > patrick@dave:~$ ls -l /dev/stdin > lrwxrwxrwx 1 root root 15 2007-11-30 14:06 /dev/stdin -> /proc/self/fd/0 > patrick@dave:~$ uname > Linux Even if I would really want to ... % ls -l /proc ls: /proc: No such file or directory --=20 H.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) using & porting perl 5.6.2, 5.8.x, 5.10.x on HP-UX 10.20, 11.00, 11.11, & 11.23, SuSE 10.1 & 10.2, AIX 5.2, and Cygwin. http://qa.perl.org http://mirrors.develooper.com/hpux/ http://www.test-smoke.org http://www.goldmark.org/jeff/stupid-disclaimers/
From: ilmari (Dagfinn Ilmari =?utf-8?Q?Manns=C3=A5ker?=) Date: 16:53 on 28 Jan 2008 Subject: Re: pdftotext Nicholas Clark <nick@xxxx.xxx> writes: > On Mon, Jan 28, 2008 at 05:30:26PM +0100, H.Merijn Brand wrote: >> On Mon, 28 Jan 2008 16:17:01 +0000, ilmari@xxxxxx.xxx (Dagfinn Ilmari >> Mannsåker) wrote: > >> > This is the kind of hatefulness /dev/stdin >> >> Do not start new hate on that :) >> >> % ls -al /dev/std* >> ls: /dev/std*: No such file or directory >> >> We're not all on Linux. > > $ ls -l /dev/stdin > lrwxr-xr-x 1 root wheel 4 Jan 1 1970 /dev/stdin -> fd/0 > $ uname > FreeBSD > > True. We're not. $ ls -l /dev/stdin lrwxrwxrwx 1 root root 6 Apr 27 2007 /dev/stdin -> ./fd/0 $ uname SunOS Indeed.
From: Tony Finch Date: 18:15 on 28 Jan 2008 Subject: Re: pdftotext On Mon, 28 Jan 2008, H.Merijn Brand wrote: > > % ls -al /dev/std* > ls: /dev/std*: No such file or directory > > using & porting perl 5.6.2, 5.8.x, 5.10.x on HP-UX 10.20, 11.00, 11.11, Some people will insist on making life difficult for themselves. Tony.
From: Robert Rothenberg Date: 17:51 on 28 Jan 2008 Subject: Re: pdftotext ------=_Part_13823_13320036.1201542673328 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 28/01/2008, Peter da Silva <peter@xxxxxxx.xxx> wrote: > > On 2008-01-28, at 05:39, Nicholas Clark wrote: > > You're a Unix filter command. You should ALWAYS be writing to stdout. > > And reading from stdin. > > > Anything else would be hateful and broken and counterintuitive. > > The worst I've seen is a command that demanded a "-o" option with the > file name for output, and wouldn't run without it. Don't for get dd. ------=_Part_13823_13320036.1201542673328 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline <br><br><div><span class="gmail_quote">On 28/01/2008, <b class="gmail_sendername">Peter da Silva</b> <<a href="mailto:peter@xxxxxxx.xxx">peter@xxxxxxx.xxx</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> On 2008-01-28, at 05:39, Nicholas Clark wrote:<br>> You're a Unix filter command. You should ALWAYS be writing to stdout.<br><br>And reading from stdin.<br><br>> Anything else would be hateful and broken and counterintuitive.<br> <br>The worst I've seen is a command that demanded a "-o" option with the<br>file name for output, and wouldn't run without it.</blockquote><div><br>Don't for get dd.<br> <br></div><br></div> ------=_Part_13823_13320036.1201542673328--
From: Peter da Silva Date: 18:44 on 28 Jan 2008 Subject: Re: pdftotext On 2008-01-28, at 11:51, Robert Rothenberg wrote: >> The worst I've seen is a command that demanded a "-o" option with the >> file name for output, and wouldn't run without it. > > Don't for get dd. dd <file >file works just fine. I'm talking about a program that had no provision at all for reading from stdin, writing to stdout, but still needed an "option" flag for a non-optional parameter. I don't even recall what it was now, it's long enough ago that I can only recall the hate.
From: orc (david parsons) Date: 00:09 on 29 Jan 2008 Subject: Re: pdftotext In article <20080128113917.GJ38653@xxxx.xxxxxxx.xxx>, Nicholas Clark <nick@xxxx.xxx> wrote: >SYNOPSIS > pdftotext [options] [PDF-file [text-file]] > >... > > Pdftotext reads the PDF file, PDF-file, and writes a text file, text- > file. If text-file is not specified, pdftotext converts file.pdf to > file.txt. If text-file is '-', the text is sent to stdout. > > >No. Dammit. You're a Unix filter command. You should ALWAYS be writing to >stdout. Anything else would be hateful and broken and counterintuitive. Well, it *is* open source(tm), so broken and counterintuitive would seem to be a design goal here. ____ david parsons \bi/ Is it hateful if it's designed to be hateful? \/
Generated at 10:26 on 16 Apr 2008 by mariachi