Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2010
    Posts
    529

    Force Windows to release folder for deleting??

    Hi all,

    This goes to you out there that know about the API, dll, etc things...

    In my app, I create a temp folder that is used for various things. Before closing the app, i can successfully delete all the files, etc inside the folder, but I am unable to delete the folder, or any sub-folders. I tried to delete the sub-folders first and then the "root" temp folder but with no luck.

    Is there a way to tell/force Windows (?) to release the folder so that it can be deleted by the app before closing it?

    Cheers,
    Dean
    Last edited by MadDogDean; 01-25-2011 at 04:25 AM.

  2. #2
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    Chances are you need to "change your current directory" before deleting the folder -- it may be "actively in use"
    Other than that -- you could include something like "Unlocker" and run it's command line; but I don't advise that as a real solution.


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  3. #3
    Join Date
    Apr 2010
    Posts
    529
    Hi Josh,

    Thanks for the idea. But... how can I release the "current directory"? I tried to set Folder.SetCurrent, but that didn't work; I still get a "Unable to delete folder" error.

    I am using a folder to temporarily uncompress zips, and I want to delete the folder when the app closes. The files have been deleted, it's just an empty folder.

    Cheers,
    Dean

  4. #4
    Join Date
    Apr 2010
    Posts
    529
    Hi Josh,

    Thanks for the idea. But... how can I release the "current directory"? I tried to set Folder.SetCurrent, but that didn't work; I still get a "Unable to delete folder" error.

    I am using a folder to temporarily uncompress zips, and I want to delete the folder when the app closes. The files have been deleted, it's just an empty folder.

    Cheers,
    Dean

  5. #5
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    I applaud you for wanting to clean up after yourself.
    My guess is that perhaps the zip dll is holding on to the folder. Try unloading the plugin.
    If nothing works, since you're down to just the folder -- use File.DeleteOnReboot() on the folder & call it good.


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

  6. #6
    Join Date
    Apr 2010
    Posts
    529
    Hey Josh,

    I might be MadDogDean, but I am house trained...

    Although I'm using the native AMS zip functions, I see what you're saying. Perhaps even I can try to write a small temp.txt file to the _TempFolder, delete the offending folder and then delete the file - never had trouble deleting files.

    Thanks again, and once you get the bugs worked out of the AMSCleanup, let me know. I'll be waiting with bated (or DogBone) breath.

    Cheers,
    Dean

  7. #7
    Join Date
    Jan 2001
    Location
    Anderson Island, WA, USA
    Posts
    2,863
    I'll try to get to it this week -- but I'm busy with the paying stuff...


    (Click here to contact me)
    Providing Independent Professional Consulting Services for
    IndigoRose products, World Wide.
    Located in -8:00 (-7:00 DST) GMT Timezone (Western United States)

Posting Permissions

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