From: ryl AT innovix DOT com (Raymond Y. Lillard) Subject: File permission _feature_ 20 Nov 1997 13:51:52 -0800 Message-ID: Reply-To: gnu-win32 AT cygnus DOT com Content-Type: text To: gnu-win32 AT cygnus DOT com Sergey, et. al. I believe I have found a case where the gnu-win32 file permission behavior and modification date update behavior differs from the reference platform (i.e. Linux and SunOS in my case). I have observed this _feature_ while testing a bash shell function I wrote to strip those pesky characters from my text files. Please see the following bash session: ryl AT JERRY: ryl AT JERRY: date Wed Nov 19 17:38:38 GMT-8:00 1997 ryl AT JERRY: umask 077 ryl AT JERRY: ll Eq_lease.txt -rw------- 1 0 everyone 15355 Jan 25 1996 Eq_lease.txt ryl AT JERRY: cp Eq_lease.txt Eq_lease.cpy ryl AT JERRY: ll Eq_lease.* -rw------- 1 0 everyone 15355 Nov 19 17:39 Eq_lease.cpy -rw------- 1 0 everyone 15355 Jan 25 1996 Eq_lease.txt ryl AT JERRY: ryl AT JERRY: type strip strip is a function strip () { tmp_file="/tmp/`date +%j%H%M%S`"; for f in $*; do cp $f $tmp_file; tr -d '\15' <$tmp_file >./$f; rm $tmp_file; done } ryl AT JERRY: chmod 644 Eq_lease.cpy ryl AT JERRY: ll Eq_lease.* -rw-r--r-- 1 0 everyone 15355 Nov 19 17:44 Eq_lease.cpy -rw------- 1 0 everyone 15355 Jan 25 1996 Eq_lease.txt ** Feature 1 ** Use of the "chmod" command as above should not modify the file modification date/time stamp. In the Unix world, a change of the file permission writes on the i-node, not the file, hence the file content remains unaltered. ryl AT JERRY: ryl AT JERRY: strip Eq_lease.cpy ryl AT JERRY: ll Eq_lease.* -rw------- 1 0 everyone 15030 Nov 19 17:47 Eq_lease.cpy -rw------- 1 0 everyone 15355 Jan 25 1996 Eq_lease.txt ryl AT JERRY ** Feature 2 ** I would expect using 'tr' as above to cause bash to dup() stdout and call freopen() on the existing file "Eq_Lease.cpy" thus keeping the permission word unchanged. I am using Sergey's cygwin32.dll and bash: ryl AT JERRY: bash --version GNU bash, version 2.01.0(4)-release (i386-pc-cygwin32) Copyright 1996 Free Software Foundation, Inc. ryl AT JERRY: ident cygwin.dll cygwin.dll: $Id: regexp.c,v 1.5 1995/06/07 03:55:49 cgd Exp $ $Id: regerror.c,v 1.3 1993/08/26 00:45:33 jtc Exp $ $Id: regsub.c,v 1.4 1995/06/05 19:42:35 pk Exp $ ryl AT JERRY: I confess to not having downloaded the sources and looked for this. I don't feel this a real serious problem, when you play in a cathouse (WinNT), you should expect things to be a bit messy. This may well be a side effect of something goofy NT does. I am just beginning to learn NT, so it would take me a while to get to the bottom of this. It would be nice to see it fixed. I do sincerely appreciate the efforts of those who work on gnu-win32 and cygwin32 as it is helping me by easing my pain as I learn NT. Thanks for listening. I apologize if this has been dealt with, I'm rather new to this environment. Regards, Ray PS: BTW, why is $Id$ not being compiled into all modules in "cygwin32.dll"? Please don't tell me this code is not being controlled with CVS. ;-) -- "We must respect the other fellow's religion, but only in the sense and to the extent that we respect his theory that his wife is beautiful and his children smart." [H.L. Mencken, Minority Report, 1956] -- Raymond Y. Lillard Innovix Technologies, Inc. ray DOT lillard AT innovix DOT com Suite 200 v:415-366-6964 643 Bair Island Rd. http://www.innovix.com Redwood City, CA USA - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".