×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Bangalore
    Posts
    285

    Deleting folders and subfolders- problem with a scenario

    Hi all,
    I am developing a filebrowser kind of software i want to delete files and folder . I am able to delete files usung BaflUtis or RFs. I am also able to delete folders if they contain only files. This is the code i am using to delete folders

    Tint err = BaflUtils:eleteFile(fsSession,*fileName,CFileMan::ERmDir);
    err = fsSession.RmDir(*fileName);
    This code works fine however if the folder contains a subfolder the folder is not deleted . All the files however are deleted except the folder and subfolder remain.

    Is there any way to do achieve this
    ??
    Regards
    Shashi Kiran G M

  2. #2
    Regular Contributor
    Join Date
    Jul 2008
    Posts
    179

    Re: Deleting folders and subfolders- problem with a scenario

    Just search for CDirScan in SDK help.

    You need to scan directory, after finishing whatever you are doing right now. Then if you find Dir as empty, then delete it.

  3. #3
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Bangalore
    Posts
    285

    Re: Deleting folders and subfolders- problem with a scenario

    Yes i looked up CDirScan and found two API's SetScanDataL() and NextL(). Should do the trick i guess... Thanks a lot.
    Regards
    Shashi Kiran G M

  4. #4
    Regular Contributor
    Join Date
    Jan 2007
    Location
    Bangalore
    Posts
    285

    Re: Deleting folders and subfolders- problem with a scenario

    NextL() gives the subfolder with a folder. i.e only till a depth 0f 1. if the depth is 3 i.e folder contains a subfolder and sub folder inturn contains another folder. In such case i have no option but to loop i guess.
    Regards
    Shashi Kiran G M

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,335

    Re: Deleting folders and subfolders- problem with a scenario

    Have you tried this: Folder Operations ?
    Nokia Developer Wiki Moderation team

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •