Board logo

标题: zip file systerm问题 [打印本页]

作者: sd_sopc    时间: 2007-5-24 00:51     标题: zip file systerm问题

我照系统的导航建了一个zip file systerm的工程,就下面的程序,运行结果是

Reading file 'file1.txt' from ZipFS...
Cannot open file.

而且我在文件里也找不到 file1.txt和file2.txt啊??

请高手指点以下应该怎么做的啊?

int main(void)
{
 FILE* fp =  NULL;

  /*
   * Open and print contents of ZipFS file 1.
   */
  printf("Reading file 'file1.txt' from ZipFS...\n");
 
  fp = fopen ("/mnt/rozipfs/file1.txt", "r");
 if (fp == NULL)
 {
  printf ("Cannot open file.\n");
  exit (1);
 }

  print_file_contents(fp);

 fclose (fp);


  /*
   * Open and print contents of ZipFS file 2.
   */
  printf("Reading file 'file2.txt' from ZipFS...\n");
 
  fp  = fopen ("/mnt/rozipfs/file2.txt", "r");

  if (fp == NULL)
  {
    printf ("Cannot open file.\n");
    exit (1);
  }

  print_file_contents(fp);

  fclose (fp);
 
  printf("\nAll files successfully read.\n");
  printf("\nExiting....\n");

 return 0;
}






欢迎光临 电子技术论坛_中国专业的电子工程师学习交流社区-中电网技术论坛 (http://bbs.eccn.com/) Powered by Discuz! 7.0.0