Re: Problem with -i ignore-file option in version 6.9 ptx in cygwin environment
Eric - In that original email your were replying to John Cowan, so I thought you were talking about coding approaches. From your message posted to the Cygwin list, I take it you were offering me, the end user, a way to solve the problem. I know about d2u and could use that now that I know what the problem is, but I'm not familiar with binary vs text mounts on a Windows system. I'm referencing the ignore file with the command line option of --ignore-file=ptx_ignore.txt. How do I involve a text mount with that? Another aspect of this problem from the end user point of view is the different behavior in the handling of the ignore file vs the main data input file. I constructed both files in the same way (using vim on Windows). ptx reads and processes the standard input just fine, but from the user's point of view, just ignores the content of the ignore file. :-) If nothing else, it would help if the man page for ptx had something about this issue. Thanks for listening, Graig - Original Message From: Eric Blake [EMAIL PROTECTED] To: cygwin@cygwin.com; Graig McHendrie [EMAIL PROTECTED] Sent: Sunday, October 14, 2007 7:18:19 AM Subject: Re: Problem with -i ignore-file option in version 6.9 ptx in cygwin environment -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Graig on 10/14/2007 7:51 AM: The message below generated an email thread amongst the gnu folks, to which, I reiterate what I said in that thread: I maintain the cygwin port of coreutils. Cygwin's philosophy is a bit different from some of the other ports to windows: when using binary mounts, cygwin's goal is to behave like Linux. Since ptx on Linux has the same behavior in treating \r literally, that is why I have made no effort for cygwin to behave any differently when you are using a cygwin binary mount. Put another way, the fact that you use a binary mount on cygwin is an agreement on your part to use files that are binary-compatible with Linux (ie no \r line endings), and tools like d2u should be used to convert problem files on a cygwin binary mount. On the other hand, you can use a cygwin text mount, which will ignore the \r with no recompilation required. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHEiUr84KuGfSFAYARArL0AJ9rl3IaBfKaPeiyo3MPnkAmyw5ZggCgw8ha hkKSvZ/vLHlcWKwQumXjTsU= =Xxwb -END PGP SIGNATURE- -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
Problem with -i ignore-file option in version 6.9 ptx in cygwin environment
The message below generated an email thread amongst the gnu folks, the last of which suggested I post the problem to this list. I'm just now doing that in hopes this problem can be resolved. Below this original message is a copy of what I judge to be the most pertinent email from the resulting discussion. - Forwarded Message From: Graig [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, September 5, 2007 10:45:41 AM Subject: Problem with -i ignore-file option in version 6.9 ptx in cygwin environment Hi - I've found that the only way that ptx will correctly use the contents of the ignore-file is if that file is formatted in the Unix style with just an octal 012 (LF) between lines. If it is formated in the DOS style with octal 015 (CR) and 012 (LF) between lines, the results are as though the ignore-file wasn't specified at all. Attached is a small zip file that demonstrates the problem. The contents are: SplForPtx.txt - sample input for the ptx command ptx_ignore.w.txt - an ignore-file formatted in dos mode ptx_ignore.u.txt - an ignore-file formatted in unix mode MakeSplPtx.bat- a script that will create output using the two different ignore files ShopTips.w.ptx- output when using the dos formatted ignore-file ShopTips.u.ptx- output when using the unix formatted ignore-file Graig McHendrie -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to John Cowan on 9/5/2007 8:25 PM: In this particular case, the subject line shows that the port in question is Cygwin, but this is not a Cygwin-specific issue. I maintain the cygwin port of coreutils. Cygwin's philosophy is a bit different from some of the other ports to windows: when using binary mounts, cygwin's goal is to behave like Linux. Since ptx on Linux has the same behavior in treating \r literally, that is why I have made no effort for cygwin to behave any differently when you are using a cygwin binary mount. Put another way, the fact that you use a binary mount on cygwin is an agreement on your part to use files that are binary-compatible with Linux (ie no \r line endings), and tools like d2u should be used to convert problem files on a cygwin binary mount. On the other hand, you can use a cygwin text mount, which will ignore the \r with no recompilation required. If you disagree with the cygwin philosophy, or with the particular implementation of that philosophy as embodied by ptx, you are better off raising the issue on the cygwin mailing lists rather than here. The Windows line-ending convention is now all over the place. With file services like NFS, AFS, and CIFS, it's not uncommon for non-MS systems to have to process MS text files (and indeed vice versa; many though not all native MS text tools now cope with Unix-style line endings). Line-ending bugs ought not to be rejected out of hand any more. This argument, on the other hand, is appropriate to bring up here, as you are claiming that ptx's behavior should be able to (optionally) ignore \r on all platforms. In which case, Jim's proposed patch of adding O_TEXT is inappropriate on two counts - it will not affect Linux (while you argued that Linux should also have a way to ignore \r), and it will make the default behavior of a cygwin binary mount diverge from behavior of Linux (which goes counter to cygwin's goal of behaving like Linux when used on binary mounts). - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFG3+6w84KuGfSFAYARAoMrAJwJURZydzupzLCLAC8elgPwCQVnpwCgt+nW a5BkH55d0kd48nN+mCeYD4g= =8lYp -END PGP SIGNATURE- cygcheck.out Description: Binary data attachment: ptx.ignore_problem.zip -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/
V5.94 ptx -i ignore-file doesn't appear to work
On receiving this message, Paul Eggert of the coreutils group suggested I send this information to the cygwin mailing list, since he is using the Linux version. The message at the bottom shows my original report to Paul along with his demonstration of ptx working as expected. The message above that (immediately below), shows where I duplicated his files and command line to produce output that is not as expected. Graig === Paul - thanks for the very speedy response. I copied my files [for backup] then used Windows copy-and-paste to create files with your content. Here's a copy of my cygwin window, showing I get different results with the same version of ptx: --- [EMAIL PROTECTED] ~ $ cd d: [EMAIL PROTECTED] /cygdrive/d $ cd graig/inventry [EMAIL PROTECTED] /cygdrive/d/graig/inventry $ cat if.txt a and the with [EMAIL PROTECTED] /cygdrive/d/graig/inventry $ cat MS_OS_clips.txt a and the with hooboy [EMAIL PROTECTED] /cygdrive/d/graig/inventry $ ptx -i if.txt -r -f MS_OS_clips.txt a and the with hooboy a and the with hooboy a and the with hooboy a and the with hooboy [EMAIL PROTECTED] /cygdrive/d/graig/inventry $ ptx --version | sed 1q ptx (GNU coreutils) 5.94 [EMAIL PROTECTED] /cygdrive/d/graig/inventry $ -- ? Graig Paul Eggert wrote: Graig McHendrie [EMAIL PROTECTED] writes: Using a command such as ptx -i if.txt -r -f MS_OS_clips.txt out.txt, where if.txt is a file with one word to a line, such as: a and the with produces permuted output that includes a, and, the, and with as key words. Hmm, I don't observe this problem with coreutils 5.94: $ cat if.txt a and the with $ cat MS_OS_clips.txt a and the with hooboy $ ptx -i if.txt -r -f MS_OS_clips.txt a and the with hooboy $ ptx --version | sed 1q ptx (GNU coreutils) 5.94 Cygwin Configuration Diagnostics Current System Time: Sat Apr 08 05:36:23 2006 Windows XP Professional Ver 5.1 Build 2600 Service Pack 1 Path: C:\cygwin\usr\local\bin C:\cygwin\bin C:\cygwin\bin C:\cygwin\usr\X11R6\bin c:\Perl\bin\ c:\WINDOWS\system32 c:\WINDOWS c:\WINDOWS\System32\Wbem c:\Program Files\ATI Technologies\ATI Control Panel c:\PROGRA~1\F-Secure\Ssh c:\Program Files\Common Files\Roxio Shared\DLLShared c:\Lotus\Notes\Graigmch c:\Program Files\QuickTime\QTSystem\ c:\Program Files\Common Files\Teleca Shared Output from C:\cygwin\bin\id.exe (nontsec) UID: 1005(Graig)GID: 513(None) 513(None) 544(Administrators) 545(Users) Output from C:\cygwin\bin\id.exe (ntsec) UID: 1005(Graig)GID: 513(None) 513(None) 544(Administrators) 545(Users) SysDir: C:\WINDOWS\System32 WinDir: C:\WINDOWS USER = 'Graig' PWD = '/home/Graig' HOME = '/home/Graig' MAKE_MODE = 'unix' HOMEPATH = '\Documents and Settings\Graig' MANPATH = '/usr/local/man:/usr/man:/usr/share/man:/usr/autotool/devel/man:' APPDATA = 'C:\Documents and Settings\Graig\Application Data' HOSTNAME = 'Graig_8250' TERM = 'cygwin' PROCESSOR_IDENTIFIER = 'x86 Family 15 Model 2 Stepping 7, GenuineIntel' WINDIR = 'C:\WINDOWS' USERDOMAIN = 'GRAIG_8250' OS = 'Windows_NT' ALLUSERSPROFILE = 'C:\Documents and Settings\All Users' DEFAULT_CA_NR = 'CA6' !:: = '::\' TEMP = '/cygdrive/c/DOCUME~1/Graig/LOCALS~1/Temp' COMMONPROGRAMFILES = 'C:\Program Files\Common Files' QTJAVA = 'C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip' USERNAME = 'Graig' PROCESSOR_LEVEL = '15' PS5ROOT = 'C:\Program Files\Roxio\PhotoSuite\' SYSTEMDRIVE = 'C:' USERPROFILE = 'C:\Documents and Settings\Graig' PS1 = '\[\033]0;\w\007 [EMAIL PROTECTED] \[\033[33m\w\033[0m\] $ ' LOGONSERVER = '\\GRAIG_8250' PROCESSOR_ARCHITECTURE = 'x86' !C: = 'C:\cygwin\bin' SHLVL = '1' PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH' HOMEDRIVE = 'C:' PROMPT = '$P$G' COMSPEC = 'C:\WINDOWS\system32\cmd.exe' TMP = '/cygdrive/c/DOCUME~1/Graig/LOCALS~1/Temp' SYSTEMROOT = 'C:\WINDOWS' CVS_RSH = '/bin/ssh' PROCESSOR_REVISION = '0207' CLASSPATH = 'C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJava.zip' INFOPATH = '/usr/local/info:/usr/info:/usr/share/info:/usr/autotool/devel/info:/usr/autotool/stable/info:' PROGRAMFILES = 'C:\Program Files' NUMBER_OF_PROCESSORS = '1' SESSIONNAME = 'Console' COMPUTERNAME = 'GRAIG_8250' OLDPWD = '/usr/bin' _ = '/usr/bin/cygcheck' POSIXLY_CORRECT = '1' HKEY_CURRENT_USER\Software\Cygnus Solutions HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2 HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus