Help for fopen()

Joel Sherrill joel.sherrill at oarcorp.com
Tue Jul 31 19:42:09 UTC 2007


Kate Feng wrote:
> I must have missed some simple setup steps  that
> fopen() does not seem to work anymore.
>
>   
If this is a new statically linked application, did
you remember to configure IMFS and enough
file descriptors?

So many possible problems with so little to guess
on but I will try.
> fopen("mydir/test.dat","w") returns error 2 : "/* No such file or
> directory */"
>
> even though it does exist.
>
>   
I assume pwd = /.
> fopen("test.dat","w") returns a file descriptor and
> no error message.  However, "test.dat" does not exist.
> Even if  "test.dat" exists and is world writable, it
> does not seem to respond to the following
>
>   
This is probably not it but you asked for simple explanations.
When I use the tarfs loader and have an empty directory in
it, I have to be careful to do mkdir on empty directories
at startup because "cvs up -Pd' will remove them and my
automatically created rootfs.tar image won't have it.
> fprintf(fp, "test\n");
>   fflush(fp);
>   fsync(fileno(fp));
>   fclose(fp);
>
> The file still remains empty and  untouched.
>
> Any  assistance is highly appreciated.
>
> Regards,
> Kate
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   




More information about the users mailing list