Not a bad idea to check specifically for the name of the offending file -- but I think I came up with a more general solution that seems to work. . . adding a -s test (file size is 0) seems to filter out Icon files and probably will snag other problematic files as well. Does anyone see potential problems with this solution? ------------------------------------------------------------ At 06:33:36 -0700 (MST) 1/28/1999, Paul J. Schinder: >Try just adding $_ ne "Icon\n" && at the beginning here. That should skip >right over the Icon files and only the Icon files. (The reason the \n = >\015 is there is because that's actually part of the name. You see it as >an extra line when MacPerl prints out the string.) > >But you might want to see if this is the only folder that gives you this >problem first, by putting it somewhere out of the way. > > >----- >Paul J. Schinder >schinder@pobox.com ------------------------------------------------------------ At 06:29:15 -0700 (MST) 1/28/1999, Chris Nandor wrote: >Do a specific check. Annoying, but it is only one line, and it will work. > > next if $file eq "Icon\n"; > >That is if you have the file name only. If you have a whole path as you do >above, then you can do: > > next if $file =~ /:Icon\n$/; > >If you aren't sure which you have, then you could do something like: > > next if $file =~ /(^|:)Icon\n$/; > >So Icon will come right after either the beginning of the string or after a >colon. ------------------------------------------------------------ >At 10:40 PM -0700 1/27/99, Ero Brown wrote: >> >> I have a script that examines every file in a directory. >> I get the following error when my script encounters (tries >> to open) an invisible icon file: >> >> # Can't open file MacHD:DevApps:MacPerl:cpan-mac-0.21:blib:lib:Convert:Icon >> >> I've tried doing the following tests on all the files >> in the directory, and the Icon file still falls through >> the filter: >> >> ((-e $_) && (-f $_) && (-T $_) && (-r $_)) >> >> Do I need to check the OS of the host perl system running >> my script and do a Mac specific file check if the script >> is running on a Mac? What Mac specific call would I use? ***** Want to unsubscribe from this list? ***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch