[ECOS] JFFS2, can?t open a file

Andrew Lunn andrew@lunn.ch
Tue Mar 28 09:17:00 GMT 2006

On Tue, Mar 28, 2006 at 09:40:24AM +0200, (infor) miren illarramendi wrote:
> Hello,
> I'm trying to write a file in a flash using the jffs2 but when I try
> to open the file it fails. I'm using an ARMermelator board.

> First, I call a function named access to know if I can access to the
> file or not. This function returns a valid value, but when I try to
> open the file it gives me an error.

The access() function is hard to implement on an embedded system.
This is especially true when the filesystem has user,group,other
access permissions. Which user is accessing the file? Which group is
this user a member of? The access() function will basically tell you
if the file exists or not. It does not try to check if you have
permissions to access it. 

It could be that jffs2 permissions on the file are r--r--r-- so you
have no rights to open the file for writing. 

So, two suggestions. 

Single step into the open code and see why jffs2 is refusing to open
the file.

Look at the output from stat(). What permissions are on the file.


Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

More information about the Ecos-discuss mailing list