icon Top 9 categories map      RocketAware > Perl >

readdir DIRHANDLE

Tips: Browse or Search all pages for efficient awareness of Perl functions, operators, and FAQs.



Home

Search Perl pages


Subjects

By activity
Professions, Sciences, Humanities, Business, ...

User Interface
Text-based, GUI, Audio, Video, Keyboards, Mouse, Images,...

Text Strings
Conversions, tests, processing, manipulation,...

Math
Integer, Floating point, Matrix, Statistics, Boolean, ...

Processing
Algorithms, Memory, Process control, Debugging, ...

Stored Data
Data storage, Integrity, Encryption, Compression, ...

Communications
Networks, protocols, Interprocess, Remote, Client Server, ...

Hard World
Timing, Calendar and Clock, Audio, Video, Printer, Controls...

File System
Management, Filtering, File & Directory access, Viewers, ...

    
readdir DIRHANDLE
Returns the next directory entry for a directory opened by opendir(). If used in a list context, returns all the rest of the entries in the directory. If there are no more entries, returns an undefined value in a scalar context or a null list in a list context.

If you're planning to filetest the return values out of a readdir(), you'd better prepend the directory in question. Otherwise, because we didn't chdir() there, it would have been testing the wrong file.

    opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
    @dots = grep { /^\./ && -f "$some_dir/$_" } readdir(DIR);
    closedir DIR;

Source: Perl builtin functions
Copyright: Larry Wall, et al.
Next: readline EXPR

Previous: read FILEHANDLE,SCALAR,LENGTH,OFFSET



(Corrections, notes, and links courtesy of RocketAware.com)


[Overview Topics]

Up to: Directory Access




Rapid-Links: Search | About | Comments | Submit Path: RocketAware > Perl > perlfunc/readdir.htm
RocketAware.com is a service of Mib Software
Copyright 2000, Forrest J. Cavalier III. All Rights Reserved.
We welcome submissions and comments