01-13-2016 01:43 AM
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.
01-14-2016 07:16 AM - edited 01-14-2016 07:16 AM
all fixed. Just needed to convert integer to char and output it as a pointer and not open the file twice. Job done :)
01-14-2016 07:16 AM - edited 01-14-2016 07:16 AM
all fixed. Just needed to convert integer to char and output it as a pointer and not open the file twice. Job done :)