[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PERL] Eksisterer en fil eller et katalog?



Tak, men hvad nu hvis jeg kun har noget af et filnavn? Sagen er at jeg leder
efter nogle datafiler, som er på følgende form: [navn].[et decimaltal].txt
fx.: jens.222.txt. Tallet i midten angiver en position og er ukendt. Hvis
datafilerne er i kataloget, vil der ligge mange af dem, afhængig af hvor
mange positioner der er data for.

Jeg havde forestillet mig noget i retning af:
if (/^$navn/, readdir DIR) {     (her checker jeg på starten af filnavnet)
  // de er der!
}

// Christian Wix

"Anders Bruun Olsen" <sslug@sslug> wrote in message
news:sslug@sslug
> On Friday 25 January 2002 21:21, you wrote:
> > Findes er en måde hvorpå jeg kan kontrollere om en fil eller et katalog
> > eksisterer? Hvordan?
>
> if (-e "file_or_dir_name") {
>   // do stuff
> }
>
> --
> Anders
> -----BEGIN GEEK CODE BLOCK-----
> Version: 3.12
> GO d--@ s:+ a-- C++ $UL++ P++ L+++ E- W+ N(+) o K? w !O M-- V
> PS+ PE@ Y+ PGP+ t 5 X R+ tv+ b+ DI+++ D+ G e- h !r y?
> ------END GEEK CODE BLOCK------
>




 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 19:54 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *