Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2006
    Posts
    77

    How to group pathes according to...

    My apps deletes some files from _ProgramfilesFolder, _WindowsFolder, Documents and settings folder etc. Each folders may be on a different drives. I want to know how many space did deleting free up. So I should get free space (Drive.GetFreeSpace) before and after deleting of each drive of this folders and subtract first result from the second. Now I would get amount (in mb) of deleted files on each drive. Then I should add this numbers to get size of all deleted files.
    But, If the path to windows folder and program files folder has the same drive letter, then the overall size would be wrong because I add two (or more) result from the same drive together!

    So first I should get drive letters from all pathes and group it according to these letters and then get free space before and after deleting and finally, add result together.
    But how to group it? Any similar ideas? Any other ideas? Please help!

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    you can use String.SplitPath to get the drive letter


    Code:
    sPath = String.SplitPath("C:\\Program Files\\My Product\\MyFile.ext");
    nSpace = Drive.GetFreeSpace(sPath.Drive);
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Sep 2006
    Posts
    77

    once please...

    Yes, I know. Then I would get f.e.:
    C, D, C, E, D, C, C from each path. But how to get free space only once per letter - from: C, D, E ? If I get free space from the same drive twice or more, the result will be wrong (multiplicated).

  4. #4
    Join Date
    Sep 2006
    Posts
    77

    Help!

    Nobody knows?

  5. #5
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    Use a table to store the paths that have been checked, or even just the drive letters and if they have already been searched before then skip it and move onto the next one.

    Either that or get the free space before deletion, then once you have deleted the files you want, get the free space again and get the difference to find out how much space was freed.

Similar Threads

  1. Best way to share custom buttons with the group?
    By mwreyf1 in forum AutoPlay Media Studio 6.0
    Replies: 10
    Last Post: 04-28-2010, 01:29 PM
  2. How to install in the "Autostart" group ?
    By virtualoffice in forum Setup Factory 7.0
    Replies: 1
    Last Post: 12-13-2006, 05:21 AM
  3. Service load order dependency on group
    By ketorin in forum Setup Factory 6.0
    Replies: 5
    Last Post: 12-05-2003, 06:47 AM
  4. how do I group single mp3's to play non stop?
    By georallim in forum AutoPlay Media Studio 4.0
    Replies: 2
    Last Post: 06-17-2003, 08:51 AM

Posting Permissions

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