Issue with IFileMgr | developer.brewmp.com Issue with IFileMgr | developer.brewmp.com

Developer

Issue with IFileMgr

Forums:

Hi,
I am facing lots of issues with IFileMgr.

I am trying to recursively delete files and directory in a path.
None are read-only or hidden. Still many times arbitrarily, IFileMgr returns EFAILED. When I test the error condition it says 266 ( using getlasterror api) which is invalid operation!

This is with BREW Simulator having just basic code to delete files.

Any thoughts on resolving this issue ?

Thanks,
Ash

I have no problems deleting files and directories recursively. Obviously if you try to delete a directory before its subdirectories / contained files you will encounter problems. You will also experience problems (like a crash on some devices) if you attempt to RmDir a file or Remove a directory.
What does your code look like?

I have no problems deleting files and directories recursively. Obviously if you try to delete a directory before its subdirectories / contained files you will encounter problems. You will also experience problems (like a crash on some devices) if you attempt to RmDir a file or Remove a directory.
What does your code look like?

Hi Ben,
I have removed off all files and then do a RmDir on the directory.
At times the IFileMgr_EnumInit returns an EFAILED, which is weird.
Not sure if it's a memory issue or an issue with the system i am executing the code on ?
Thanks,
Ash

Hi Ben,
I have removed off all files and then do a RmDir on the directory.
At times the IFileMgr_EnumInit returns an EFAILED, which is weird.
Not sure if it's a memory issue or an issue with the system i am executing the code on ?
Thanks,
Ash

It should be no problem.
Could you post you code?
I believe it is bug of your code.

It should be no problem.
Could you post you code?
I believe it is bug of your code.

yes it was an issue with my code.
But, I did find an issue wiht IFileMgr,
If you use IFileMgr Enuminit for directory parsing and you delete the directory using ifilemgr_rmdir, then the enumerator leaves off the last directory.
(To delete directory first delete off all files/folders under it.)

yes it was an issue with my code.
But, I did find an issue wiht IFileMgr,
If you use IFileMgr Enuminit for directory parsing and you delete the directory using ifilemgr_rmdir, then the enumerator leaves off the last directory.
(To delete directory first delete off all files/folders under it.)

The documentation for IFILEMGR_Enum* doesn't say anywhere that it is explicitly safe to modify the files/directories being iterated, so I always assumed it wasn't safe. Your experience bears this out.

The documentation for IFILEMGR_Enum* doesn't say anywhere that it is explicitly safe to modify the files/directories being iterated, so I always assumed it wasn't safe. Your experience bears this out.

Well.. File deletion works properly when enumerating.. So this is clearly a bug.
BenBlaukopf wrote:The documentation for IFILEMGR_Enum* doesn't say anywhere that it is explicitly safe to modify the files/directories being iterated, so I always assumed it wasn't safe. Your experience bears this out.

Well.. File deletion works properly when enumerating.. So this is clearly a bug.
BenBlaukopf wrote:The documentation for IFILEMGR_Enum* doesn't say anywhere that it is explicitly safe to modify the files/directories being iterated, so I always assumed it wasn't safe. Your experience bears this out.