How to copy the file in simulator? | developer.brewmp.com How to copy the file in simulator? | developer.brewmp.com

Developer

How to copy the file in simulator?

Forums:

HI

I have a question.

My source code use a file.
The file must be located with executable file in simulator.

But I don't know where executable file.

and How to copy the file in simulator?

Thanks.

You dont need to know the location of the executable. Opeing files with no path should open them in your current directory, although its safer to use the "fs" specifications and call IFILEMGR_CheckPathAccess to make sure you have the rights.
Once you ave read the file into a buffer, you can write it out to another buffer and call the save funhctions on a second file handle to perform a 'copy'.

You dont need to know the location of the executable. Opeing files with no path should open them in your current directory, although its safer to use the "fs" specifications and call IFILEMGR_CheckPathAccess to make sure you have the rights.
Once you ave read the file into a buffer, you can write it out to another buffer and call the save funhctions on a second file handle to perform a 'copy'.

My code is
filename = "data";
file = IFILEMGR_OpenFile( fileMgr, filename, _OFM_READ );
but return error "EFILENOEXISTS"
in simulator.
Where should I position the file? (visual studio 2005 dev env.)
with source code? or with mif directory?

My code is
filename = "data";
file = IFILEMGR_OpenFile( fileMgr, filename, _OFM_READ );
but return error "EFILENOEXISTS"
in simulator.
Where should I position the file? (visual studio 2005 dev env.)
with source code? or with mif directory?

OK, I see. The file should be in the app directory (not the debug or release directory ).

OK, I see. The file should be in the app directory (not the debug or release directory ).

how to copy a file to another file

how to copy a file to another file

how to copy a file to another file

how to copy a file to another file

You'll have to open the file, read it in to memory and then write it out to the new file. AFAIK there isn't a copy file api. BTW you should be using the new IFileSystem2 and IFilePort1 as the old IFile apis are deprecated.

You'll have to open the file, read it in to memory and then write it out to the new file. AFAIK there isn't a copy file api. BTW you should be using the new IFileSystem2 and IFilePort1 as the old IFile apis are deprecated.