+#include <stdlib.h>
+#include <strings.h>
+
+FILE* emufs_idx_abrir(EMUFS* efs, const char* mode)
+{
+ FILE* f;
+ char* filename;
+
+ filename = (char*) malloc(sizeof(char) * (strlen(efs->nombre)
+ + strlen(EMUFS_IDX_EXT) + 1));
+ if (filename == NULL) {
+ /* TODO Manejo de errores */
+ return NULL;
+ }
+ strcpy(filename, efs->nombre);
+ strcat(filename, EMUFS_IDX_EXT);
+ f = fopen(filename, mode);
+ free(filename);
+ return f;
+}