Bug 57105

Summary: mpage -H prints ctime of text file but should print mtime
Product: [Retired] Red Hat Linux Reporter: Robert K. Moniot <moniot>
Component: mpageAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-06-13 16:54:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Attachments:
Description Flags
patches for text.c and mpage.1 to fix feature and documentation of it none

Description Robert K. Moniot 2001-12-04 22:22:35 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.78 [en] (X11; U; Linux 2.4.9-12 i586)

Description of problem:
This is a feature since the man page clearly says that -H uses the file
change
time.  However, the change time is the Wrong Time to use, since it is
updated when
any file attributes are changed.  For instance, if the file is backed up
using
tar --atime-preserve, the ctime of the file becomes the time when the
backup was
done.   Don't try to tell me this isn't BROKEN!  Also, pr uses mtime (as
does enscript)
and the man page sort of implies that mpage should behave like pr, since
this is what
it uses by default under -p.

Version- mpage-2.5.1-5


How reproducible:
Always

Steps to Reproduce:
1. Create a short text file (or use an old one lying around).  Assume it is
named foo.txt.
2. Change its ctime without changing mtime:
       chmod +x foo.txt ; chmod -x foo.txt
3. Look at ctime and mtime; they will be different.
       ls -lc foo.txt ; ls -l foo.txt
4. Format the file using mpage and give output a header
       mpage -H1 foo.txt | lpr
	

Actual Results:  The time in the output header is ctime, not mtime.

Expected Results:  Since mpage conforms to its man page, the expected
results after reading the man
page are the same as the actual results.  However, the expected (and
desired) results
before reading the man page were that the time in the output header should
be mtime.

Additional info:

I did not find any way to tell mpage to select mtime as an alternative to
ctime.
The only workaround is manually put the date in the -h header, or use -p
which unfortunately also puts irrelevant "pr -l66 -w80" in the header.
I would be happy with an additional command-line option to select mtime.

Comment 1 Robert K. Moniot 2001-12-26 20:40:48 UTC
Created attachment 41370 [details]
patches for text.c and mpage.1 to fix feature and documentation of it

Comment 2 Tim Waugh 2002-06-14 14:15:12 UTC
I agree.  Fixed in mpage-2.5.2-2.