cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Explorer
Explorer
7,261 Views
Registered: ‎09-08-2014

mfs_file_open

Jump to solution

int mfs_file_open (char *filename, int mode)

 

Parameters  filename: file to be opened

                     mode: Read/Write or Create mode.

 

Returns    The index of filename in the array of open files or -1 on failure.

 

Description Open file filename with given mode.

                     The function should be used for files and not directories:

                     MODE_READ, no error checking is done (if file or directory).

                     MODE_CREATE creates a file and not a directory. MODE_WRITE

                     fails if the specified file is a DIR.

 

Includes      xilmfs.h

(see http://www.xilinx.com/ise/embedded/edk82i_docs/sa_xilmfs_v1_00_a.pdf)

 

The above is all that I can find to explain this function.

   

I am using the above as:

 

fd = mfs_file_open(filename, MODE_CREATE);

 

 

So when it works it returns "The index of filename in the array of open files". Closing the file should mean what? That the index will be decremented?

 

If I use MODE_CREATE to open a file do you then need to set the mode to MODE_WRITE to write to it?

 

I'm trying to delete the image from an mfs file and write a new image back into it. 

 

 

                 

0 Kudos
Reply
1 Solution

Accepted Solutions
Explorer
Explorer
13,863 Views
Registered: ‎09-08-2014

all fixed. Just needed to convert integer to char and output it as a pointer and not open the file twice. Job done :)

View solution in original post

0 Kudos
Reply
1 Reply
Explorer
Explorer
13,864 Views
Registered: ‎09-08-2014

all fixed. Just needed to convert integer to char and output it as a pointer and not open the file twice. Job done :)

View solution in original post

0 Kudos
Reply