[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: [CPROG] hvordan 'læser' man et dir?



On Tue, 7 Sep 1999, torben fjerdingstad wrote:

> I sådanne situationer er `apropos' god, f.eks. `apropos directory'.
> Man kan også f.eks. nemt se hvordan `ls' gør med `strace ls'.

$ apropos directory|wc
    132    1256    8703

Ugh. Jeg har *alle* mansider i  SUSE installeret :)

> ls bruger getdents().
> 
> Det fører frem til `man 2 getdents'
> 
> Hvis man vil have en rekursiv fil liste er ftw() god.
> Ellers er den blevet forældet ligesom readdir()?

Den readdir() der er blevet forældet er *systemkaldet* readdir.

For at læse kataloger skal du stadig bruger *bibliotekskaldet* readdir
(altsaa man 3 readdir for biblioteksfunktion, og man 2 readdir for
systemkald). Denne kalder så getdents().


PS: Linux-Kongress var fedt!

-- 
==============================================================================
Erwin Andreasen   Herlev, Denmark <sslug@sslug>          UNIX System Programmer
<URL:http://www.andreasen.org>              <*>              Goodbye, Richard!
==============================================================================



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:07 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] *