www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/07/08/13:19:03

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <840686.40123.qm@web25406.mail.ukl.yahoo.com>
Date: Wed, 8 Jul 2009 17:18:41 +0000 (GMT)
From: "R. Diez" <rdiezmail-cygwin AT yahoo DOT de>
Subject: -d "/cygdrive/r" return false under Cygwin if R: is a CD-ROM
To: cygwin AT cygwin DOT com
MIME-Version: 1.0
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi everybody:

I have come across an interesting problem with Cygwin's perl and rsync. If =
I insert a data CD-ROM on drive R: , the following perl one-liner works fin=
e:

  perl -e 'if (-d "/cygdrive/r") { print "yes\n" } else { print "no\n" }'

That means, I get "yes" printed out. This one, however, does not (I get
"no"). The only difference is the "use strict;" at the beginning:

  perl -e 'use strict; if (-d "/cygdrive/r") { print "yes\n" } else { print=
 "no\n" }'

Could you think of a reason why the "use strict;" at the beginning could ma=
ke a difference?

I hope someone can help confirm this problem, that would be enough for now.=
 I have reported this issue on perl 5 porters before, but got no confirmati=
on, and I was asked to post here, see this message:

  http://www.nntp.perl.org/group/perl.perl5.porters/2009/04/msg145767.html

I have seen this effect on a completely different machine, with Windows Vis=
ta
instead of Windows XP, and with rather different hardware. Note that I have
changed my CD-ROM drive letter from the default D: to R: (for Reader) with =
Window's disk admin tool.

My other machine has a second W: (for Writer) drive. All my drives are from=
 manufacturer LG, some of them rather old, some pretty new. I have just tes=
ted on another Windows XP (also German) with another brand of CD recorder /=
 DVD reader, and I still get the same problem. However, I have tested on a =
Spanish Windows XP with LG drives, and that was fine (!).

I also had rsync refusing to copy files from the CD-ROM because the files w=
ere "non-regular" (but the cp command does copy the files alright). Neither=
 "-device" nor any of the "--links-xxx" options would help. So I dug a litt=
le deeper and realised that ls was reporting the files and directores as sp=
ecial, block or character devices, see below. That is probably the reason w=
hy perl is sometimes (but not always) having problems with that drive.

$ uname -a
CYGWIN_NT-5.1 MYMACHINE 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin

$ ls -la /cygdrive/r
total 4581112
br-------T 8910  285212672 3221225472  6656,  8897 Jan 15  1979 .
dr-xr-xr-x    1          0 root                  0 Jan  1  1970 ..
cr-------T 8910 4286353920 1577058303 27004, 37376 Jan 15  1979 MD5SUMS.txt
cr-------T 8910 3934034145 3967586836 55296,  9281 Jan 15  1979 debian-40r1=
-i386-DVD-1.iso

Did you notice the 'b' and the 'c' at the beginning of the file listing?

This is the output from the test program on the post referenced above:

$ ./test.exe /cygdrive/r
Device Type        : 2
Characteristics    : 121
Volume Name        : <Debian4.0r1>
Serial Number      : 3707807536
Max Filenamelength : 255
Filesystemname     : <UDF>
Flags              : 80005
  FILE_CASE_SENSITIVE_SEARCH  : TRUE
  FILE_CASE_PRESERVED_NAMES   : FALSE
  FILE_UNICODE_ON_DISK        : TRUE
  FILE_PERSISTENT_ACLS        : FALSE
  FILE_FILE_COMPRESSION       : FALSE
  FILE_VOLUME_QUOTAS          : FALSE
  FILE_SUPPORTS_SPARSE_FILES  : FALSE
  FILE_SUPPORTS_REPARSE_POINTS: FALSE
  FILE_SUPPORTS_REMOTE_STORAGE: FALSE
  FILE_VOLUME_IS_COMPRESSED   : FALSE
  FILE_SUPPORTS_OBJECT_IDS    : FALSE
  FILE_SUPPORTS_ENCRYPTION    : FALSE
  FILE_NAMED_STREAMS          : FALSE
  FILE_READ_ONLY_VOLUME       : TRUE
  FILE_SEQUENTIAL_WRITE_ONCE  : FALSE
  FILE_SUPPORTS_TRANSACTIONS  : FALSE

I've also tried with other CD-ROM media to no avail.

I wonder under what circumstances would cygwin report CD-ROM directories an=
d files as special block/character devices..

Please cc me on the answer, as I'm not subscribed to this list.

Many thanks,
  Ruben





--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019