#6 Opening file with invalid path creates file in root

closed
nobody
None
5
2006-03-14
2006-01-25
igorus
No

efsl-0.2.6

I was trying to open file with path was invalid and
have found that file_fopen succesfully opens file.
Moreover it creates file in ROOT dir and it's posible
to have 2 file with same name in ROOT in result (if
there allredy was a file with the same name).

sample code:

if (efs_init(&efs,0))
{
return (-1);
}

if(file_fopen(&file,&efs.myFs,"/test.txt",'w')!=0)
{
return (-1);
}
file_write(&file, 5, "FILE1");
file_fclose(&file);
if(file_fopen(&file,&efs.myFs,"/dir/test.txt",'w')!=0)
{
return (-1);
}
file_write(&file, 5, "FILE2");
file_fclose(&file);
fs_flushFs(&efs.myFs);

Discussion

  • Lennart

    Lennart - 2006-03-14
    • status: open --> closed
     
  • Lennart

    Lennart - 2006-03-14

    Logged In: YES
    user_id=1223110

    Fixed in 0.2.7

    Nasty little bugger ;)
    This bugs shows that the file/dir management code is
    somewhat far from optimal.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks