Re: [ANNOUNCEMENT] Updated [experimental]: coreutils-6.9-5

2007-08-27 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Ehud Karni on 8/22/2007 3:02 PM:
 I have mounted the NTFS on my Linux (Centos5) using the `mount.cifs'
 command. It is a case-sensitive OS with a case-sensitive FS but with
 case-insensitive mediator (the XP hosting OS). I think the Cygwin
 situation is almost exactly the same. However there is a big difference
 in how `mv' works on Cygwin and Linux:

That's somewhat to be expected, as my case-insensitive patch is
cygwin-specific.

 # ll *c
 -rwxrwxrwx+ 1  None 34 Aug 22 23:09 TST.uc

Hmm, your /etc/passwd file needs to be updated.

 
 # mv tst.uc TsT.lc
 # ll *c
 -rwxrwxrwx+ 1  None 34 Aug 22 23:09 TsT.lc

Yes, the rename occurs even if the first argument did not match the case
of the file on disk.

 
 # mv tst.lc tst.lc
 mv: `tst.lc' and `tst.lc' are the same file

Intentional.  My patch specifically does not attempt a case rename when
the two arguments are identical, even if the two identical arguments
differ in case from the disk file, under the idea that a user may not be
aware that they are spelling the filename with a different case.  It is
only when the two arguments differ in case that I check whether a
case-renaming was requested.  I could perhaps be persuaded to change this,
but right now I'm inclined to leave it the way it is.

- --
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

iD8DBQFG0sRp84KuGfSFAYARAvsVAKC9D1MvYeQy6kmAcUx7Y11yDk44mQCgxIil
VQioKYDj1plZ6yDoHHY483k=
=tGdU
-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/



Re: [ANNOUNCEMENT] Updated [experimental]: coreutils-6.9-5

2007-08-22 Thread Corinna Vinschen
On Aug 21 15:47, Eric Blake wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 According to Reini Urban on 8/21/2007 3:26 PM:
  This is a minor patch release.  It attempts to add some
  case-insensitivity
  smarts to mv, cp, and install.  In other words, 'mv a A' should now cause
  the file to be renamed, rather than reporting an error, if 'a' and 'A'
  happen to be case-insensitive synonyms for the same file.
  
  Great, thanks!
  Are you planning to submit the patch upstream?
 
 My patch turned out to be more invasive than I would have liked.  Also,
 there have been upstream discussions on the problem (since Mac HFS, and
 even Linux mounts to FAT, are also affected).  The biggest problem is that
 my patch uses sys/cygwin.h, which is NOT portable - there really is no
 good way (at the moment) across all three platforms to tell if a directory
 is case-insensitive.  It would be nice if there was a pathconf(directory,
 _PC_CASE_INSENSITIVE) that could quickly be queried to see if
 case-insensitivity is even worth worrying about for the directory in
 question.  Also brought up on the coreutils list is the problem that the
 kernel's notion of file system case-insensitivity may be different from
 the current locale's definition of case-insensitivity (not really an issue
 for cygwin so long as we don't really support locales, but definitely an
 issue for Linux and Mac).

Dunno if that's helpful for the discussion, but on second (third?)
thought, *maybe* it's not a boundless good idea to manage
case-insensitivity generically in coreutils without explicit OS support
like the above _PC_CASE_INSENSITIVE flag for pathconf.

First, a simple test with FAT on Linux shows that case-insensitivity of
the underlying file system is not necessarily handled correctly by the
OS.  On Linux, rename(a, A) is a no-op on FAT, according to the
POSIX rule that rename is a no-op if src and dest are hardlinks to the
same file(*).  To fix this behaviour in coreutils, it would be necessary
to *know* that the underlying FS is case-insensitive (is there any flag
to exchange between Linux kernel and FS driver?  I don't know), and to
rename the file in two steps (a - $tmpname - A).

Second, even if a FS appears case-insensitive, it isn't necessarily so.
NTFS is case-sensitive.  The case-insensitivity is actually handled by
the Windows kernel.  Basically, a flag in calls to functions taking a
filename as parameter is all it takes to make a function call
case-insensitive or not(**).  The Win32 calls all use case-insensitivity.
Some are switchable to work case-sensitive, but it's not of much help
since other calls are always case-insensitive.  Cygwin handles all file
system calls case-insensitive, too.  So far.

So, in the Linux/FAT example we have a case-sensitive OS with a
case-insensitive FS, with Win32/NTFS (Cygwin/NTFS) we have a
case-insensitive OS with a case-sensitive FS.  While the NT kernel can
return information about the case-sensitivity of the underlying FS (***)
(), I don't know about other OSes.

So we're back to fpathconf(_PC_CASE_INSENSITIVE): It appears that
case-insensitive operation on the POSIX application level depends on
such a flag.  I'm also planning to allow case-sensitive operation on
NTFS in Cygwin at one point, which would make this flag necessary as
well.  I don't think it would ever become part of the POSIX standard,
though.


Corinna



(*)   In theory, Cygwin's rename could do the same and still move within
  POSIX rules, no matter how frustrating this behaviour might be.

(**)  Plus a registry setting since XP.

(***) See the FILE_CASE_SENSITIVE_SEARCH file system flag:
  http://cygwin.com/ml/cygwin/2007-08/msg00013.html

() As far as the underlying FS returns the correct flags, of course.

-- 
Corinna Vinschen  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader  cygwin AT cygwin DOT com
Red Hat

--
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/



Re: [ANNOUNCEMENT] Updated [experimental]: coreutils-6.9-5

2007-08-22 Thread Reini Urban

Corinna Vinschen schrieb:

So, in the Linux/FAT example we have a case-sensitive OS with a
case-insensitive FS, with Win32/NTFS (Cygwin/NTFS) we have a
case-insensitive OS with a case-sensitive FS.  While the NT kernel can
return information about the case-sensitivity of the underlying FS (***)
(), I don't know about other OSes.


BTW, I just improved the perl API concerning Win32 case-tolerance.

perldoc File::Spec

Cygwin
Cygwin case-tolerance depends on managed mount settings and as with 
MsWin32 on GetVolumeInformation() ouFsFlags == FS_CASE_SENSITIVE, 
indicating the case significance when comparing file specifications.

Default: 1

MsWin32
MSWin32 case-tolerance depends on GetVolumeInformation() ouFsFlags == 
FS_CASE_SENSITIVE, indicating the case significance when comparing file 
specifications.

Since XP FS_CASE_SENSITIVE is effectively disabled for the NT subsubsystem.
See http://cygwin.com/ml/cygwin/2007-07/msg00891.html
Default: 1

Interestingly:
Epoc, VMS, OS2 and Mac are all case tolerant, too.


So we're back to fpathconf(_PC_CASE_INSENSITIVE): It appears that
case-insensitive operation on the POSIX application level depends on
such a flag.  I'm also planning to allow case-sensitive operation on
NTFS in Cygwin at one point, which would make this flag necessary as
well.  I don't think it would ever become part of the POSIX standard,
though.


Corinna



(*)   In theory, Cygwin's rename could do the same and still move within
  POSIX rules, no matter how frustrating this behaviour might be.

(**)  Plus a registry setting since XP.

(***) See the FILE_CASE_SENSITIVE_SEARCH file system flag:
  http://cygwin.com/ml/cygwin/2007-08/msg00013.html

() As far as the underlying FS returns the correct flags, of course.

--
Reini Urban
http://phpwiki.org/  http://murbreak.at/
http://helsinki.at/  http://spacemovie.mur.at/

--
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/



Re: [ANNOUNCEMENT] Updated [experimental]: coreutils-6.9-5

2007-08-22 Thread Ehud Karni
On Wed, 22 Aug 2007 10:30:15 Corinna Vinschen wrote:

 Second, even if a FS appears case-insensitive, it isn't necessarily so.
 NTFS is case-sensitive.  The case-insensitivity is actually handled by
 the Windows kernel.  Basically, a flag in calls to functions taking a
 filename as parameter is all it takes to make a function call
 case-insensitive or not(**).  The Win32 calls all use case-insensitivity.
 Some are switchable to work case-sensitive, but it's not of much help
 since other calls are always case-insensitive.  Cygwin handles all file
 system calls case-insensitive, too.  So far.

 So, in the Linux/FAT example we have a case-sensitive OS with a
 case-insensitive FS, with Win32/NTFS (Cygwin/NTFS) we have a
 case-insensitive OS with a case-sensitive FS.  While the NT kernel can
 return information about the case-sensitivity of the underlying FS (***)
 (), I don't know about other OSes.

I have mounted the NTFS on my Linux (Centos5) using the `mount.cifs'
command. It is a case-sensitive OS with a case-sensitive FS but with
case-insensitive mediator (the XP hosting OS). I think the Cygwin
situation is almost exactly the same. However there is a big difference
in how `mv' works on Cygwin and Linux:

Cygwin test:

# pwd
/U/VID-shared/Incoming/subtitles/tmp

# ll *c
-rwxrwxrwx+ 1  None 34 Aug 22 23:09 TST.uc

# mv tst.uc TsT.lc
# ll *c
-rwxrwxrwx+ 1  None 34 Aug 22 23:09 TsT.lc

# mv tst.lc tst.lc
mv: `tst.lc' and `tst.lc' are the same file

# mv Tst.lc tst.lc
mv: `Tst.lc' and `tst.lc' are the same file

Linux test:

# pwd
/ehuds/U/VID-shared/Incoming/subtitles/tmp

# ll *c
-rw-rw 1 root root 34 Aug 22 23:09 TsT.lc

# mv tst.lc tst.lc
mv: `tst.lc' and `tst.lc' are the same file

# mv tSt.lc tst.lc

# ll *c
-rwxrwSrwt 1 root root 34 Aug 22 23:09 tst.lc


Please note the difference:
On both system the mv tst.lc tst.lc fails with same file error,
but mv Tst.lc tst.lc (i.e. case change only) fails only on Cygwin,
On the Linux it just works. May be the Cygwin1 DLL or the Cygwin `mv'
should do less checking and so it might `just work' too ?

Ehud.



--
 Ehud Karni   Tel: +972-3-7966-561  /\
 Mivtach - Simon  Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D http://www.keyserver.net/Better Safe Than Sorry

--
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/



[ANNOUNCEMENT] Updated [experimental]: coreutils-6.9-5

2007-08-21 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

A new release of coreutils, 6.9-5, is available for experimental use,
leaving 6.9-4 as current.

NEWS:
=
This is a minor patch release.  It attempts to add some case-insensitivity
smarts to mv, cp, and install.  In other words, 'mv a A' should now cause
the file to be renamed, rather than reporting an error, if 'a' and 'A'
happen to be case-insensitive synonyms for the same file.  I've tested
this with disk files, virtual files (such as /proc), and managed mounts,
but not with CYGWIN=check_case.  Also, because it is a big enough patch, I
am leaving this as an experimental release for a while longer in case some
regressions turn up.

See also the upstream documentation in /usr/share/doc/coreutils-6.9/.

DESCRIPTION:

GNU coreutils provides a collection of commonly used utilities essential
to a standard POSIX environment.  It comprises the former textutils,
sh-utils, and fileutils packages.  The following executables are included:

[ base64 basename cat chgrp chmod chown chroot cksum comm cp csplit cut
date dd df dir dircolors dirname du echo env expand expr factor false fmt
fold gkill groups head hostid hostname id install join link ln logname ls
md5sum mkdir mkfifo mknod mv nice nl nohup od paste pathchk pinky pr
printenv printf ptx pwd readlink rm rmdir seq sha1sum sha224sum sha256sum
sha384sum sha512sum shred shuf sleep sort split stat stty su sum sync tac
tail tee test touch tr true tsort tty uname unexpand uniq unlink users
vdir wc who whoami yes

UPDATE:
===
To update your installation, click on the Install Cygwin now link on the
http://cygwin.com/ web page.  This downloads setup.exe to your system.
Save it and run setup, answer the questions, then look for 'coreutils' in
the 'Base' category (it should already be selected).  Since this is an
experimental release, you will need to use the 'Exp' radio button.

DOWNLOAD:
=
Note that downloads from sources.redhat.com (aka cygwin.com) aren't
allowed due to bandwidth limitations.  This means that you will need to
find a mirror which has this update, please choose the one nearest to you:
http://cygwin.com/mirrors.html

QUESTIONS:
==
If you want to make a point or ask a question the Cygwin mailing list is
the appropriate place.

- --
Eric Blake
volunteer cygwin coreutils maintainer

CYGWIN-ANNOUNCE UNSUBSCRIBE INFO:
=
To unsubscribe to the cygwin-announce mailing list, look at the
List-Unsubscribe:  tag in the email header of this message.  Send email
to the address specified there.  It will be in the format:

[EMAIL PROTECTED]

If you need more information on unsubscribing, start reading here:

http://sources.redhat.com/lists.html#unsubscribe-simple

Please read *all* of the information on unsubscribing that is available
starting at this URL.
-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

iD8DBQFGy1UH84KuGfSFAYARAgK+AJ9K7PSu8NcAGfFJyOpms+xbw/QTowCffmzE
2ist03Zkc+IivoZbJcX3PwE=
=Q4+d
-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/



Re: [ANNOUNCEMENT] Updated [experimental]: coreutils-6.9-5

2007-08-21 Thread Reini Urban

Eric Blake schrieb:

A new release of coreutils, 6.9-5, is available for experimental use,
leaving 6.9-4 as current.

NEWS:
=
This is a minor patch release.  It attempts to add some case-insensitivity
smarts to mv, cp, and install.  In other words, 'mv a A' should now cause
the file to be renamed, rather than reporting an error, if 'a' and 'A'
happen to be case-insensitive synonyms for the same file.  I've tested
this with disk files, virtual files (such as /proc), and managed mounts,
but not with CYGWIN=check_case.  Also, because it is a big enough patch, I
am leaving this as an experimental release for a while longer in case some
regressions turn up.


Great, thanks!
Are you planning to submit the patch upstream?


See also the upstream documentation in /usr/share/doc/coreutils-6.9/.

--
Reini Urban
http://phpwiki.org/  http://murbreak.at/
http://helsinki.at/  http://spacemovie.mur.at/

--
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/



Re: [ANNOUNCEMENT] Updated [experimental]: coreutils-6.9-5

2007-08-21 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

According to Reini Urban on 8/21/2007 3:26 PM:
 This is a minor patch release.  It attempts to add some
 case-insensitivity
 smarts to mv, cp, and install.  In other words, 'mv a A' should now cause
 the file to be renamed, rather than reporting an error, if 'a' and 'A'
 happen to be case-insensitive synonyms for the same file.
 
 Great, thanks!
 Are you planning to submit the patch upstream?

My patch turned out to be more invasive than I would have liked.  Also,
there have been upstream discussions on the problem (since Mac HFS, and
even Linux mounts to FAT, are also affected).  The biggest problem is that
my patch uses sys/cygwin.h, which is NOT portable - there really is no
good way (at the moment) across all three platforms to tell if a directory
is case-insensitive.  It would be nice if there was a pathconf(directory,
_PC_CASE_INSENSITIVE) that could quickly be queried to see if
case-insensitivity is even worth worrying about for the directory in
question.  Also brought up on the coreutils list is the problem that the
kernel's notion of file system case-insensitivity may be different from
the current locale's definition of case-insensitivity (not really an issue
for cygwin so long as we don't really support locales, but definitely an
issue for Linux and Mac).

- --
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

iD8DBQFGy11X84KuGfSFAYARAk4dAJ0T6yzwWh2pnizEegbLiwuXBRSY7wCfdT2Z
uHj5vysrCux/ADGKaM8QEJE=
=fj4M
-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/