Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 8 of 8
  1. #1
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790

    Thumbs up Get Folder Size DLL

    Here is a small free dll (8.5 kb) that will return the size of a folder. It is very fast even on large folders. You can use Luacom to get the size of a folder but I found that it failed on large folders. Also Luacom will add 288 kb to your app where as this dll only adds 8.5 kb.

    Use the link below to go to the xDialog site where you can download an AMS project which contains the dll and shows how to use it.

    Download
    Dermot

    I am so out of here

  2. #2
    Join Date
    Nov 2006
    Posts
    306
    nice release. You made that in VB? Looks similar to a dll I made in the past

    Sincerely,
    Casper

  3. #3
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    Thanks.

    It's not VB.
    Dermot

    I am so out of here

  4. #4
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    Very nice. But why not use the String.GetFormattedSize action?

    Code:
    -- Get the folder
    sFolder = Input.GetText("Input1")
    
    -- If no folder is entered, then exit
    if sFolder == "" then
    	Dialog.Message("No Folder", "Please enter a folder.", MB_OK, MB_ICONEXCLAMATION)
    	return
    end
    
    -- Call the dll to get the size
    Size = DLL.CallFunction(_SourceFolder.."\\AutoPlay\\Docs\\xFolderSize.dll", "GetFolderSize", "\""..sFolder.."\"", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL)
    
    -- Convert the return value to a number
    Size = String.ToNumber(Size)
    
    -- Get the formatted size
    FormattedSize = String.GetFormattedSize(Size, FMTSIZE_AUTOMATIC, true);
    
    -- Show the result
    Label.SetText("result", "Size: "..FormattedSize)

  5. #5
    Join Date
    Apr 2004
    Location
    Vancouver, Canada
    Posts
    1,790
    But why not use the String.GetFormattedSize action?
    Has that function always been there? I never saw it before.
    Dermot

    I am so out of here

  6. #6
    Join Date
    Mar 2004
    Location
    Toronto, ON CANADA
    Posts
    696
    Hey, it's not like I haven't done that before... at least I know I'm not the only one.

  7. #7
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    That innate AMS function came about shortly after I posted about how to format the sizes. I believe Brett saw that example and created an AMS Action based off of it.

    Which is, .

    Intrigued

  8. #8
    Join Date
    Mar 2005
    Location
    WA 'wait a while' - Australia
    Posts
    872
    Very handy and robust Dermot, thanks for the dll

    xDialog looks very usefull too

    just a bit of tighter example code for your xFolderSize.dll

    Code:
    -- Get the folder
    sFolder = String.TrimRight(Input.GetText("Input1"), nil);
    -- If an invalid entry, then exit
    if ((sFolder == "") or (not Folder.DoesExist(sFolder))) then
    	Dialog.Message("No Target Folder Data", "Please enter a valid folder path");
    	return;
    end
    -- Call the dll to get the size, converting the return value(type "string") to a number
    nSize = String.ToNumber(DLL.CallFunction(_SourceFolder.."\\AutoPlay\\Docs\\xFolderSize.dll", "GetFolderSize", "\""..sFolder.."\"", DLL_RETURN_TYPE_STRING, DLL_CALL_STDCALL));
    sSize = String.GetFormattedSize(nSize, FMTSIZE_AUTOMATIC, false);
    -- Show the result
    Label.SetText("result", "Size: "..sSize);
    tks again

Similar Threads

  1. Folder size
    By malihu in forum AutoPlay Media Studio 6.0
    Replies: 0
    Last Post: 07-19-2006, 06:59 AM
  2. Example: Sending An Email Through Outlook
    By Brett in forum AutoPlay Media Studio 5.0 Examples
    Replies: 22
    Last Post: 12-05-2005, 06:11 PM
  3. cookies
    By goukilord10 in forum AutoPlay Media Studio 5.0
    Replies: 6
    Last Post: 05-20-2005, 04:08 PM
  4. calculating folder size
    By sferguson in forum AutoPlay Media Studio 5.0
    Replies: 1
    Last Post: 11-18-2003, 11:13 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