Hello Everybody
if the file is a symbolic link , display where it points to (readlink)
how to use readlink in C code
How to show all the file information under current directory and then output
to a file use C code
Thank You
Patrick
Hello Everybody
if the file is a symbolic link , display where it points to (readlink)
how to use readlink in C code
How to show all the file information under current directory and then output
to a file use C code
Thank You
Patrick
Here is a sample source.
#include <dirent.h>
#include <sys/stat.h>
/*------------------------------------------------------------------------* if ( (dirp = opendir ( "." )) == NULL ) { /*------------------------------------------------------------------------*
>if the file is a symbolic link , display where it points to (readlink) >How to show all the file information under current directory and then >Thank You >Patrick
main ()
{
DIR *dirp;
struct dirent *dntp;
struct stat stbuf;
int rtn;
int rtn;
char linkname[256];
perror ( "opendir" );
exit (1);
}
while ( (dntp = readdir (dirp)) != NULL ) {
rtn = lstat ( dntp->d_name, &stbuf );
if ( rtn < 0 ) continue;
printf ( "%8d %s", stbuf.st_size, dntp->d_name );
if ( (stbuf.st_mode&0xF000) == 0xA000 ) {
rtn = readlink ( dntp->d_name, linkname, 255 );
if ( rtn >= 0 ) {
}
}
putchar ( '\n' );
}
closedir (dirp);
}
>how to use readlink in C code
output
>to a file use C code
1. HELP HELP HELP HELP HELP HELP
I am doing an assignment and one othe queations is to find out how many
postings has there been this week can some one either just tell me or
tell me how to find out
2. RISCom/N2csu -- any experience with it?
3. help help help help help help
4. Solaris 2.6 , Ultra 2 CPU -> spontaneous child process
5. Help C program in linux help help
6. talk request interceptor for X?
7. Xaw scrollbars within dialog box widgets HELP:HELP:HELP:HELP:HELP:
8. 3com 3c590b (I know, I know...) - problem
10. HELP -- HELP -- HELP -- HELP
12. help help help help! please!