|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: May 2005
Messaggi: 340
|
[C] Lista cartella
Ciao a tutti, come faccio a vedere la lista completa dei una cartella? :S
|
|
|
|
|
|
#2 | |
|
Member
Iscritto dal: Sep 2004
Città: vicino a Cosenza
Messaggi: 61
|
Quote:
Per Win: http://msdn.microsoft.com/library/de..._functions.asp Per GNU/Linux: man opendir, man dirfd, ecc.
__________________
<| http://fgr.altervista.org |> <| GNU/Linux Registered User #365929 |> <| GnuPG/OpenPGP key available |> |
|
|
|
|
|
|
#3 | |
|
Senior Member
Iscritto dal: May 2005
Messaggi: 340
|
Quote:
Trovato.. cmq esiste per C... non bisogna sempre basarsi su le msdn di m$... non l'ho mai fatto e forse non lo faro mai.... si cerca sempre di farsi aiutare da m$ ma alla fine esistono siti web che con un esempio ti riassumono 8 pagine di msdn... |
|
|
|
|
|
|
#4 | ||
|
Member
Iscritto dal: Sep 2004
Città: vicino a Cosenza
Messaggi: 61
|
Quote:
Quote:
comunque se avresti postato la soluzione che hai trovato, potrebbe essere utile in futuro a qualcuno... postala magari...
__________________
<| http://fgr.altervista.org |> <| GNU/Linux Registered User #365929 |> <| GnuPG/OpenPGP key available |> |
||
|
|
|
|
|
#5 |
|
Senior Member
Iscritto dal: May 2005
Messaggi: 340
|
Posto l'esempio
Codice:
/*
* readdir.c: example usage for opendir()/readdir()/closedir()
*
* Matt Dailey, Feb 2004
*
* Compile with "gcc readdir.c" to get executable a.out.
*
* This example program prints out the files in the current
* directory
*
* Be sure to refer to "man 3 readdir" etc.
*
*/
#include <stdio.h>
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
int main( int argc, char *argv[] ) {
DIR *pDIR;
struct dirent *pDirEnt;
/* Open the current directory */
pDIR = opendir(".");
if ( pDIR == NULL ) {
fprintf( stderr, "%s %d: opendir() failed (%s)\n",
__FILE__, __LINE__, strerror( errno ));
exit( -1 );
}
/* Get each directory entry from pDIR and print its name */
pDirEnt = readdir( pDIR );
while ( pDirEnt != NULL ) {
printf( "%s\n", pDirEnt->d_name );
pDirEnt = readdir( pDIR );
}
/* Release the open directory */
closedir( pDIR );
return 0;
}
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 00:18.



















