This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RL-FlashFS: How to determine the length of a file

Hi all,

when I try to determine the lenhth of a file I use following code:

int  flength(char *filename)
{
FILE* file;
FINFO info;

  file = fopen(filename,"r");
  if(!file)
  {
    return(-1);
  }
  fclose(file);

  info.fileID = 0;
  while(ffind(filename, &info)==0);
  if(info.fileID == 0)
  {
    return(-1);
  }

  return(info.size);

}

All works fine as long as I use simple filenames like "F:test.txt".
As soon as I try to do this with filenames including subfolders ("F:\\test\\test.txt") it fails.

Is there another way to determine the length of a file?
Why won't ffind() not work with subfolders?

Any ideas?
Marco