<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hola , estoy intentando realizar una aplicación sobre Unix y estoy estancado en esta funcion :<br><br>#include<stdio.h><br>#include<dirent.h><br>#include<sys/stat.h><br>#include<sys/types.h><br><br>int main(){<br><br>    DIR *dir_act;<br>    struct dirent *dirp;<br>    struct stat fich;   <br>    char *nombre;<br>    char *ruta= "/bin";<br>    int arch_gid;<br>    double siz_arch;<br><br>    if((dir_act = opendir(ruta)) == NULL)<br>        printf("Error al abrir el directorio\n");<br><br>    dirp = readdir(dir_act);<br>    nombre=dirp->d_name;   <br>    stat(nombre,&fich);<br>    arch_gid = fich.st_gid;<br>    siz_arch= fich.st_size;<br><br>    printf("tamaño : %f \n", siz_arch);<br>   <br>   return 0;<br>}<br><br>Lo que simplemente hace es , intenta coger el tamaño del primero archivo que se encuentra en esa ruta del directorio , pero me sale un resultado sin sentido :    " tamaño : -163754450.000000 "; <br>Creo q el problema esta en la ruta , por ke si pongo "." , me sale los resultados correctos. Tb hay veces q poniendo otra runa me sale solo el primer resultado correcto y luego todo los demas del mismo tamaño q el primero , y no se por q :X .<br><br>Gracias :) .<br><br><br /><hr />Express yourself instantly with MSN Messenger! <a href='http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/' target='_new'>MSN Messenger</a></body>
</html>