X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/44e29ffea53b9da70e6b5e16f96aa0231540dd87..8190084c46a37139904c2a0114a2d3020f48282a:/tipo3/main.c diff --git a/tipo3/main.c b/tipo3/main.c index 40418e4..0e38cc5 100644 --- a/tipo3/main.c +++ b/tipo3/main.c @@ -1,20 +1,25 @@ #include +#include +#include "emufs.h" -int main ( ) +int main() { -char v[39999]; -unsigned int ID_aux = 0, a= 0,b= 0,c=0,d=0; -v[0]=0x00; -v[1]=0x31; -v[2]=0xC7; -v[3]=0x06; -a = v[0]; -b = v[1]; -c = v[2]; -d = v[3]; -ID_aux = (d << 0 ) | (c << 8) | ( b << 16) | (a << 24); + EMUFS *fp; + char a[] = "1234567890"; + int n; + char b[101]; -printf("el numero es = %x\n", ID_aux); + fp = emufs_crear("articulos", T3, 512, 100); + n = fp->grabar_registro(fp, a, strlen(a)+1); + + printf("ID = %d\n", n); + + fp->leer_registro(fp, n, b, 20); + + printf("Ok\n"); + printf("Recuperado : %s\n", b); + + emufs_destruir(fp); return 0; }