X-Git-Url: https://git.llucax.com/z.facultad/75.06/emufs.git/blobdiff_plain/d62c8c3816a5ff0a369982444f16b2c4b059da78..3291460361a5e4280b125e15f833d5ec1820c349:/tipo3/main.c diff --git a/tipo3/main.c b/tipo3/main.c index f6ab0bd..5550d0c 100644 --- a/tipo3/main.c +++ b/tipo3/main.c @@ -1,19 +1,32 @@ #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); - -printf("el numero es = %x\n", ID_aux); + EMUFS *fp; + char a[100]; + char c[100]; + int n1, n2; + char b[100]; + strcpy(a, "1234567890"); + strcpy(c, "REGISTRO NUMERO 2. ESTE REGISTRO ES MUCHO MAS LARGO QUE EL UNO"); + + fp = emufs_crear("articulos", T3, 512, 100); + + n1 = fp->grabar_registro(fp, a, 100); + n2 = fp->grabar_registro(fp, c, 100); + + printf("ID1 = %d\n", n1); + printf("ID2 = %d\n", n2); + + fp->leer_registro(fp, n1, b, 100); + + printf("Ok\n"); + printf("Recuperado : %s\n", b); + + emufs_destruir(fp); + + return 0; }