int emufs_destruir(EMUFS *e)
{
+ INDICE *del, *cur;
+
if (e == NULL) return 1;
+
+ /* libero indices */
+ cur = e->indices;
+ while (cur) {
+ del = cur;
+ cur = cur->sig;
+ emufs_indice_destruir(e, cur);
+ }
+
free(e->nombre);
free(e);
return 0;
fwrite(&cant, 1, sizeof(int), fp);
fwrite(indices, cant, sizeof(t_Indice), fp);
fclose(fp);
+ free(indices);
return 1;
}
dummy = (char*)malloc(emu->tam_bloque);
memset(dummy, 0, emu->tam_bloque);
fwrite(dummy, emu->tam_bloque, 1, fp);
- printf("new_block ftell = %d\n", ftell(fp));
switch(emu->tipo){
case T1: num = (ftell(fp)-sizeof(EMUFS_Tipo)-sizeof(EMUFS_BLOCK_SIZE))/emu->tam_bloque;
break;
switch(emu->tipo){
case T1: num = (ftell(fp)-sizeof(EMUFS_Tipo)-sizeof(EMUFS_BLOCK_SIZE))/emu->tam_bloque;
if (ftell(fp) == sizeof(EMUFS_Tipo)+sizeof(EMUFS_BLOCK_SIZE)) num = 0;
- PERR("PASE");
break;
case T3: num = (ftell(fp)-sizeof(EMUFS_Tipo)-sizeof(EMUFS_BLOCK_SIZE)-sizeof(EMUFS_REG_SIZE))/emu->tam_bloque;
if (ftell(fp) == sizeof(EMUFS_Tipo)+sizeof(EMUFS_BLOCK_SIZE)+sizeof(EMUFS_REG_SIZE)) num = 0;