Perlfrage zu Existenz von Dateien etc.

Aldo Valente aldo at dagobar.rhein.de
Sa Dez 14 10:53:40 CET 2002


Holger Nowak <holger.nowak at uni-koeln.de> writes:

> mkdir und symlink unter perl helfen mir hier nicht weiter. Da die 
> Performance doch sehr unter diesem Konstrukt leidet, meine Frage, ob es 
> nicht einen perl-Befehle à la "test" gibt?

*kicher*  Ich habe mal beim schreiben kurz mal perl mit shell
verwechselt und shift verwendet.  Nach 'ner halben Stunde ist es mir
aufgefallen -- es tat genau das was ich wollte.

Das von Dir gesuchte ist der erste Eintrag in perlfunc(1):


 Alphabetical Listing of Perl Functions


       -X FILEHANDLE
       -X EXPR
       -X      A file test, where X is one of the letters listed
               below.  This unary operator takes one argument,
               either a filename or a filehandle, and tests the
               associated file to see if something is true about
               it.  If the argument is omitted, tests "$_",
               except for "-t", which tests STDIN.  Unless other­
               wise documented, it returns "1" for true and "''"
               for false, or the undefined value if the file
               doesn't exist.  Despite the funny names, prece­
               dence is the same as any other named unary opera­
               tor, and the argument may be parenthesized like
               any other unary operator.  The operator may be any
               of:

                   -r  File is readable by effective uid/gid.
                   -w  File is writable by effective uid/gid.
                   -x  File is executable by effective uid/gid.
[...]


Aldo
-- 
Forwarded-by: Eric Steese  WHAT MEN REALLY MEAN - A CONTINUING SERIES
"I'm going to stop off for a quick one with the guys."
   Really means....
"I am planning on drinking myself into a vegetative stupor with my chest
pounding, mouth breathing, pre-evolutionary companions."



Mehr Informationen über die Mailingliste Linux-Users