[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?



thomas m. skrev:

> Hvordan læser man et directory?? Således at jeg kan liste filerne i
>directoriet. Skal bruge det i forbindelse med noget embeded linux, hvor
>den skal vise filerne på et display (og man skal så kunne udvælge sig en
>fil). Jeg har selection tingen oppe og køre, mangler altså bare at få
>hevet et directory ind i programmet..
> Og ja, det er C det er skrevet i...

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'.

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()?

-- 
torben fjerdingstad        | linux-2.2.10-smp/GNU/gnome-1.0
sslug@sslug        |   Man skal ikke skyde bjørnen
http://www.fjerdingstad.dk |     før skindet er solgt.


 
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] *