Languages

Menu
Sites
Language
File not deleting from External Storage

I have pushed a file into my SDCard folder and from my application, I am trying to delete the file , but I am getting result as E_ILLEGAL_ACCESS. The following is the piece of code I have used,

 

String modifyName;
Directory* pDir;
DirEnumerator* pDirEnum;
result r = E_SUCCESS;

    Tizen::Base::String dirName = Tizen::System::Environment::GetExternalStoragePath();
    AppLog("Memory Card Path : %ls",dirName.GetPointer());

    pDir = new Directory;
    r = pDir->Construct(dirName);
    pDirEnum = pDir->ReadN();
    while (pDirEnum->MoveNext() == E_SUCCESS)
    {
        DirEntry entry = pDirEnum->GetCurrentDirEntry();
        if(entry.IsDirectory())
        {

        }
        else
        {
            r = Tizen::Io::File::Remove("/opt/storage/sdcard/6.JPG");
            if(r == E_SUCCESS)
            {
                AppLog("File Deleted");
            }
            else if (r == E_INVALID_ARG)
            {
                AppLog("E_INVALID_ARG");
            }
            else if (r == E_ILLEGAL_ACCESS)
            {
                AppLog("E_ILLEGAL_ACCESS");
            }
            else if (r == E_FILE_NOT_FOUND)
            {
                AppLog("E_FILE_NOT_FOUND");
            }
            else if (r == E_IO)
            {
                AppLog("E_IO");
            }
        }
    }

I am trying to delete the 6.JPG file from the opt/storage/sdcard path. FYI,  I am using Tizen 2.1 (Emulator)and I have switched to root mode.

I couldn't understand why I am getting ILLEGAL_ACCESS error.

Edited by: Brock Boland on 17 Mar, 2014 Reason: Paragraph tags added automatically from tizen_format_fix module.

Responses

2 Replies
wil smith
I have replied to your other thread , for the ILLEGAL_ACCESS error
youngsik yoon
i think you should use tizen2.2. then you will not have this issue.