bug-a2ps
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: "GNU a2ps 4.13" and multiple (many!) inputfiles - it seems to be a b


From: Michael Holm (MH)
Subject: RE: "GNU a2ps 4.13" and multiple (many!) inputfiles - it seems to be a bug.
Date: Thu, 13 Dec 2007 12:38:57 +0100

Hi again.

I have found the error to be the way that xargs works.
Instead of writing:
find . | grep ".java" | sort | xargs a2ps --debug -1 --header='#!s-$f-,
-' -o output.ps

it should have been:
a2ps --debug -1 --header='#!s-$f-, -' -o output.ps `find . | grep
".java" | sort`

Sorry for disturbing you guys.

Best regards, Michael.

-----Original Message-----
From: Michael Holm (MH) 
Sent: 12. december 2007 08:43
To: 'address@hidden'
Subject: "GNU a2ps 4.13" and multiple (many!) inputfiles - it seems to
be a bug.

Hi.

I think that I have found a bug in the a2ps.
 
I have a directory with a lot of sub-directories each with some java
source-code files (plain text).

If I just tries to use a2ps with all the files with this command:
find . | grep ".java" | sort | xargs a2ps --debug -1 --header='#!s-$f-,
-' -o output.ps

, then it seems like the a2ps at some point saves the first part of the
output to the file output.ps and then continues with the rest and then
overwrites the output.ps. This results in an output file that does not
include the first part.

I have tried to debug it, and it happens a bit before file number 447.
Therefore I have used this command to investigate further:
find . | grep ".java" | sort | head -n 447 | xargs a2ps --debug -1
--header='#!s-$f-, -' -o output.ps

Part of the output where the problem seems to occur:
(first part omitted....)
[./Studieplan/Command.java (Java): 2 pages on 2 sheets]
[./Studieplan/CommandTest.java (Java): 2 pages on 2 sheets]
[./Studieplan/CommandWords.java (Java): 2 pages on 2 sheets]
[Total: 970 pages on 970 sheets] saved into the file `output.ps'
[529 lines wrapped]
[./Studieplan/CommandWordsTest.java (Java): 1 page on 1 sheet]
[./Studieplan/CourseRequirementException.java (Java): 1 page on 1 sheet]
[./Studieplan/CourseRequirementExceptionTest.java (Java): 1 page on 1
sheet] [./Studieplan/DataFiles.java (Java): 2 pages on 2 sheets]
[Total: 5 pages on 5 sheets] saved into the file `output.ps'
[4 lines wrapped]

It does not seem to be the BASH shell that gives the limit, as It do
gets the rest of the files (arguments). The problem seems to be that
a2ps restarts the output generation.

It seems to be dependent on the length of the pathnames. If I increase
the length of the main directory, then the error occurs earlier in the
process. Therefore, it might be the maximum amount of characters that
a2ps can handle, that causes the error.

Please put it on the buglist or email me the reason for its behavior. I
am very curious.

I have put all the files I am using on a web-page for download (so that
you can reproduce the error). It is located here:
http://www.holm-teknik.dk/projects_without_duplicates.tgz

(Note: When I use the command: find . | grep ".java" | sort | head -n
447 | xargs a2ps --debug -1 --header='#!s-$f-, -' -o output.ps  , then I
am inside the catalogue "projects_without_duplicates". This is were the
error will occur a bit before file number 447).

Best regards, Michael Holm.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]