Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 24 Mar 2004 11:59:06 -0800 From: Jos Backus To: cygwin AT cygwin DOT com Subject: Weird "input file is output file" error from cat Message-ID: <20040324195928.GA37678@lizzy.catnook.com> Reply-To: jos AT catnook DOT com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i (This seen after installing cygwin-inst-20040322.tar on top of 1.5.9 on Windows 2K3 Server.) It seems that in some directories, cat (from textutils-2.0.21-1) produces a strange error: /z/work/client/objects/nt/app-dbg-int-ram> touch a b c; cat a b > c /z/work/client/objects/nt/app-dbg-int-ram> cd result/ /z/work/client/objects/nt/app-dbg-int-ram/result> touch a b c; cat a b > c cat: a: input file is output file /z/work/client/objects/nt/app-dbg-int-ram/result> ls -li a b c 8385220929766002848 -rw-r--r-- 1 josb mkpasswd 0 Mar 24 11:37 a 8385220929766002849 -rw-r--r-- 1 josb mkpasswd 0 Mar 24 11:37 b 8385220929766002850 -rw-r--r-- 1 josb mkpasswd 0 Mar 24 11:36 c /z/work/client/objects/nt/app-dbg-int-ram/result> cd .. /z/work/client/objects/nt/app-dbg-int-ram> ls -li a b c 12036222075236473315 -rw-r--r-- 1 josb mkpasswd 0 Mar 24 11:36 a 12036222075236473316 -rw-r--r-- 1 josb mkpasswd 0 Mar 24 11:36 b 12036222075236473317 -rw-r--r-- 1 josb mkpasswd 0 Mar 24 11:36 c Something else that's weird: /z/work/client/objects/nt/app-dbg-int-ram> cd result /z/work/client/objects/nt/app-dbg-int-ram/result> cat a b > d cat: b: input file is output file /z/work/client/objects/nt/app-dbg-int-ram/result> cat a > d /z/work/client/objects/nt/app-dbg-int-ram/result> Note that all these files do not exist before the touch. The code in cat.c looks like this: if (check_redirection && stat_buf.st_dev == out_dev && stat_buf.st_ino == out_ino && (input_desc != STDIN_FILENO)) { error (0, 0, _("%s: input file is output file"), infile); exit_status = 1; goto contin; } But when I rebuild cat from the textutils-2.0.21-1 sources I don't see the problem. It almost looks like something is wrong with the cat in the textutils package. /bin> cygcheck.exe cat.exe Found: .\cat.exe Found: c:\dev\common\cygwin\1.5\bin\cat.exe cat.exe .\cygwin1.dll C:\WINNT\system32\ADVAPI32.DLL C:\WINNT\system32\KERNEL32.dll C:\WINNT\system32\ntdll.dll C:\WINNT\system32\RPCRT4.dll .\cygintl-1.dll /bin> Ideas, anyone? -- Jos Backus _/ _/_/_/ Sunnyvale, CA _/ _/ _/ _/ _/_/_/ _/ _/ _/ _/ jos at catnook.com _/_/ _/_/_/ require 'std/disclaimer' -- 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/