Altera_Forum
Honored Contributor
15 years agoZIPFS not working. fopen always returning NULL
Hi,
I'm using Quartus/NIOS 9.1 with SP1 and I'm trying read a binary file using Zip File System. I'm using the Legacy NIOS IDE and for test my code is:
# include "sys/alt_stdio.h"
# include "system.h"
# include <stdio.h>
# include <string.h>
# include "altera_avalon_cfi_flash.h"
# include "altera_ro_zipfs.h"
# include "alt_types.h"
int main(void)
{
... Some Code ....
FILE *pf= fopen("/mnt/rozipfs/screen.bmp","rb");
if(pf == NULL)
{
printf("File Error");
}
fread(imageDataOrigin, sizeof(float),307200,pf);
... More Code ...
}
I create the uncompressed Zip file using pkzip -e0 zipname files... After, I added the file to _syslib of project and activate the ZIPFS in Properties -> System Library -> ZIPFS. However when execute my program, I can't open my file. What I'm doing wrong? Thanks.