[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Testing for Icon files



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 $_))

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.

}
} 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?
}
} TIA for any help you can afford me,
}
} Ero Brown <ero@fiber.net>
}
}



-----
Paul J. Schinder
schinder@pobox.com

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch