Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have noticed that when I use File::Find on a hard drive it works recursively into subdirectories as expected. It does not (on my machines) if the media is read-only such as a CD. Is this normal? Is there an option to get it to work with read- only media?

Replies are listed 'Best First'.
•Re: File::Find Quirks?
by merlyn (Sage) on Jul 31, 2002 at 17:05 UTC
    Some filesystems don't properly support a "link count" for directories, like Unix does. The presumption is that if a directory contains a link count of two, then there aren't any subdirectories. Somewhere in the docs it tells how to disable this optimization, for filesystems that aren't very Unix-like.

    -- Randal L. Schwartz, Perl hacker

Re: File::Find Quirks?
by simeon2000 (Monk) on Jul 31, 2002 at 17:09 UTC
    I had the exact same problem on Cygwin under windows 98. I had to set the "follow" attribute in File::Find to 1 to get it to work right. You could give that a try, worked for me.

    As to _why_ it works/doesn't work... I don't really know.

    --
    perl -e "print qq/just another perl hacker who doesn't grok japh\n/"

Re: File::Find Quirks?
by kvale (Monsignor) on Jul 31, 2002 at 16:50 UTC
    That a file system is read-only should not make a difference. If you can change to a directory on the CD and list files, perl should be able to do the same; both processes are based on the same syscalls. Show us the code you are using and perhaps we can help debug it.

    -Mark