This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: JFFS2, can?t open a file
- From: Andrew Lunn <andrew at lunn dot ch>
- To: "(infor) miren illarramendi" <millarramendi at eps dot mondragon dot edu>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Tue, 28 Mar 2006 10:08:48 +0200
- Subject: Re: [ECOS] JFFS2, can?t open a file
- References: <A6409DF67CA5604982A3DD8F59BBF0D3674E01@enaitz1.eps.mondragon.edu>
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.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss