API call in Windows that can retrieve the size of a folder ??

API call in Windows that can retrieve the size of a folder ??

Folks,

Does anyone know of a system call (where you give the name of a directory)
and it retrieves the combined size of all the files in the folder (doesn't
have to be recursive), or a similiar call for a file????? Any suggestions
would be appreciated

Regards


0
11/5/2003 2:10:56 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
330 Views

Similar Articles

[PageSpeed] 46

    You might probably be able to use the ZwQueryInformationFile() API.

-- 
Cheers
Check Abdoul [VC++ MVP]
-----------------------------------

"Peter McCarthy" <petergmccarthy@hotmail.com> wrote in message
news:Rx7qb.4388$bD.16747@news.indigo.ie...
> API call in Windows that can retrieve the size of a folder ??
>
> Folks,
>
> Does anyone know of a system call (where you give the name of a directory)
> and it retrieves the combined size of all the files in the folder (doesn't
> have to be recursive), or a similiar call for a file????? Any suggestions
> would be appreciated
>
> Regards
>
>


0
CheckAbdoul
11/5/2003 2:22:00 PM
"CheckAbdoul" <checkabdoul at mvps dot org> wrote:

>    You might probably be able to use the ZwQueryInformationFile() API.

But...that seems to be a kernel mode function available in the DDK. I
don't think that's available to the normal application programmer.

And I don't think there's any way to get the total size of all files
in a folder other than stepping through all of them, retrieving the
size of each one, and adding it all up.

-- 
Tim Slattery
MS MVP(DTS)
Slattery_T@bls.gov
0
Slattery_T (112)
11/5/2003 5:25:26 PM
On Wed, 05 Nov 2003 12:25:26 -0500, Tim Slattery wrote:

>And I don't think there's any way to get the total size of all files
>in a folder other than stepping through all of them, retrieving the
>size of each one, and adding it all up.

Indeed. You can even see Explorer doing this if you select a large
enough folder.

If the original poster takes a look around on my website he can find
the code necessary for recursing through a directory structure, hang
on <rummage, rummage>... here :

www.mooremvp.freeserve.co.uk/Win32/framed_tip002.htm

-- 
Bob Moore [WinSDK MVP]
http://www.mooremvp.freeserve.co.uk/
(this is a non-commercial site and does not accept advertising)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not reply via email unless specifically requested to do so.
Unsolicited email is NOT welcome and will go unanswered.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0
bobm (116)
11/5/2003 9:40:25 PM
Reply:

Similar Artilces:

Can't get the proper display of a field in my report.
I have 2 tables, both using autonumbers for their primary key. The first table is for contacts (i.e. last name, first name, etc.). The second table is for businesses (business name, etc.) I have a field in my contacts table that has a number format so it can be used as a foreign key for the business table. I then set up the relationship between them & enforced referential integrity. When I run a query, I see the name of the business (after setting up a combo box) - no problem. When I run a report based on that query, a number is displayed (not the business name). Suggestions, pleas...

Limitation of Outlook Pesonal Folder
Hi Guys, Can you give me a reference where I can find information about limitation of personal Folder of MS Outlook? If its possible that the information was stated the maximum size (GB?) Thanks, Mark Here is a link to an article that talks about the Personal Folder file size limitation for Oultook 97-2002, http://support.microsoft.com/default.aspx?scid=KB;EN-US;296088. Outlook 2003 has a much larger limitation and here is a link to an article that discusses its limitations, http://support.microsoft.com/default.aspx?scid=KB;EN-US;830336. I hope this information is helpful. Robe...

window is off screen
Had to look up some 2007 Tax filing stuff today. Back then this computer had two monitors. By default, the tax stuff was sent to the second monitor, it disappears off of the screen now and I cannot look at it. Multiple dragging attemps did not work, thought there was a "key sequence" or ?? to make all windows return to the main monitor?? With two monitors connected 'drag' the stuff on #2 back to #1 - then you can stop using #2 monitor. "Meebers" <Iwork@topposter.com> wrote in message news:e8C0apRzKHA.5288@TK2MSFTNGP05.phx.gbl... > ...

Format Issue of Windows Mail and M.S. Group
Hi: When clicking to open any mails including this site, MS Newsgroup, top right pane of 'X' part is not visible. In the past, I used 'Shove-It' program that was found on the web-site, priced $15 that corrected this issue. However, this program is no longer effective, thus it went back to the original format, .... not fully opening content of mail of right side of pane, although I can read any mails by using 'maximizing bvutton' to open in full. Any imputs on this, above would be greatly appreciated. Thanks, "Winter10" <Winter10No...

PHONE CALLS
Hi, If I have phone calls scheduled within MS CRM web client how do I see what time they are scheduled for, in addition to the date? When a phone call is scheduled you can put what time it is due at. However, in my activities I cannot see what time it is due at. Best regards Lee You might be better off using appointments to schedule conference calls. They will appear on your calendar then. I think the phone call activity type is better used on spur-of-the-moment phone calls... just my opinion. Good luck! >-----Original Message----- >Hi, > >If I have phone calls scheduled...

With a Query in Access 2007, How can I Create This Query
I need a query that will list all records in table 1 for which there are no auditor records (Table 3). Somehow, I need to use the relationship between tables 2 and 3 to find what's not in table 1. The following query gives me a list of all records that do have auditor records. I'm at a dead end on this one. Query SELECT PTOTNamesTbl.PTOTAuditingTherapist, PTOTAuditingTherapist.PTOTFirstName, PTOTAuditingTherapist.PTOTLastName, AuditDetailInitialEval.TherapistLastName, PTOTNamesTbl.PTOTFirstName, PTOTNamesTbl.PTOTLastName, AuditDetailInitialEval.Medicare, AuditDet...

Can't send e-mails from Outlook 2003 after SP1
After installing service pack SP1 for Office 2003, I can't send e-mails anymore. They are stuck in the outbox folder. The error message states that the connection to the server was interrupted. I did not change any settings and checking them confirms that everything is as it should be. Did anyone else experience the same issue and how did you resolve it? Thanks for your help Matthias See if you can manually move those messages from your Outbox and then check all your settings again. "Mattliusa" <anonymous@discussions.microsoft.com> wrote in message news:cb7401c48a5...

Windows Welcome Screen Login Looping Problem
Up until now no startup problems whatsoever with my system. Today, I press the start button and it boots fine to the Windows' Welcome Screen. When I click on my account icon (no password ever entered) it tries to login (I see my desktop for about 4-5 seconds) but it comes back to the same Windows' Welcome Screen after about 5-10 seconds. My significant other also has an account icon and when she tries to login from the welcome screen she can't get pass the screen either and gets the same 5-10 seconds looping problem that happens to me. System specs: Dell Deminsio...

Can Line Chart Overlaps be Highlighted?
Can the overlap portion(s) of two lines in a chart be shown in a different color, without having to manually draw a shape? I would like to show the areas where Line A is above Line B as red, and the areas where it crosses below in blue - is it possible to do this without manually drawing in shapes? Hi, To some extent it depends how many times the lines cross. If it's just the once then you can use area charts to provide the shading. http://www.andypope.info/ngs/ng21.htm http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=590 This may help if the used one line as a base line...

Calling the Page Setup PopUp from VBA..
Hello.. I am using Access 2003 and I have a button on my form that I will have the user click to bring up the Page Setup popup screen just like you would do if you chose File -> Page Setup. Does anyone have the VBA code to accomplish this? Please advise... Cheers! Brett Try, docmd.RunCommand acCmdPageSetup Also, do not forget to trap error 2501 should the user cancel the operation. -- Hope this helps, Daniel Pineault "Brett Davis" wrote: > Hello.. > > I am using Access 2003 and I have a button on my form that I will have the > user click to br...

about MFC APIs
Hi, I am working in VC++ environment. I want to know, is there any windows APIs for screen display using buffers at pixel level Please give me suggestions awaiting the response with regards jagadeesha jagadeesha m wrote: > Hi, > > I am working in VC++ environment. I want to know, is there > any windows APIs for screen display using buffers at pixel > level > > Please give me suggestions > > awaiting the response > > with regards > jagadeesha There are several APIs for pixel-level bitmap control. All of them are explained and compared in th...

Can't sign in to 2004?
Now, another problem. I can no longer sign in with my hotmail and password if "use Money's online features that require a passport" even though I am signed on to MSN with that passport. I tried resetting the hotmail password for both MSN and Money 2004 but still can't get it to work. In microsoft.public.money, MrEKJ wrote: >Now, another problem. I can no longer sign in with my hotmail and password >if "use Money's online features that require a passport" even though I am >signed on to MSN with that passport. I tried resetting the hotmail password &...

retrieving disgruntled employees email
I currently have an employee who has some email that I need before he leaves. I am afraid when he leaves he will wipe his hard drive and information pertinent to our company will be lost. Is there any way I can get his mailbox store in a format where I can read through it? We have exchange server 2003... Thanks In news:1156938912.420497.277510@b28g2000cwb.googlegroups.com, jborgnini@tippmanngroup.com <jborgnini@tippmanngroup.com> typed: > I currently have an employee who has some email that I need before he > leaves. I am afraid when he leaves he will wipe his hard drive and...

Apply current view to all folders
Hi, I would like to apply a certain view to all sub-folders within my inbox and would like to do it without having to go to all my folders. I have many sub and sub-sub folders. I have looked and looked for an 'apply this view to all folders' button or the like but can't find. Can anyone help?? Thank you, Tracy Rhodes ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ Me again... bottom line.. How can I make every message and information look alike wit...

Can't open files
Hello -- I'm sure this isn't the proper place to post my problem, but thought I'd start here anyways. Let me start off by saying that I'm extremely computer-stupid, so please forgive my ignorance. I'm running Windows Vista Ultimate, and yahoo email. For some reason, I'm unable to open attachments that have been sent to me, and saved to my computer. PLEASE HLP!! These are important documents that I really need to access. Thanks for your help -- It's not very informative to say you are not able to open attachments. What happens when you try? Is ther...

outlook 2000 running under windows xp
Having recently received automatic updates for windows xp, outlook 2000 hangs on sending/receiving emails, is this a known problem ? I'm not aware of problems. Do you get any error messages? I'd try deleting the *.srs file. It's located at %USERPROFILE%\Local Settings\Application Data\Microsoft\Outlook -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: http://www.slipstick.com/ Outlook Tips by email: mailto:dailytips-subscribe-request@lists.outlooktips.net EMO - a weekly newsletter about Outlo...

Paging Size set up for sql 2005 best performance
erver windows 2003 sp1. 64 bits, Paging file size for selected drive C is (custom selected) Initial 2046 MB, and maximum 4092 MB. It is currently allocated 4081 MB. Computer RAM memory is 8GB. Server functions as a database MS SQL 2005 server, and it is used under heavy insert database operations The problem is that it can be seen on windows task manager there is on PF usage and Page File Usage hHstory around 8.2 GB paging file size not 4081 GB as it is given on virtual memory page set up. DoleBludger (DoleBludger@discussions.microsoft.com) writes: > erver windows 200...

email to Public folder gets NDR
When I try to send a message to PF I get a NDR and following message in Application log Event Type: Warnin Event Source: MSExchangeTranspor Event Category: Exchange Store Driver Event ID: 32 Date: 31.05.200 Time: 9:50:2 User: N/ Computer: XMAI Description The following call : EcLocallyDeliverMsg2 to the store failed. Error code : 1238 (Message-ID <C8F74733BF2C7E4888545664F83970FC47162D@xmail.1111.ru> will be NDR'd). MDB : 0a07ea5d-c42f-41d6-9b26-1b91ceddf4dd. FID : 1-41. MID : 1-23E6CB. File : . But some other users can send messages without problems.. What does this error code(...

why I can not definition a variable in My Dll.
It's a dll support MFC INT __stdcall RemoterPrint() { AFX_MANAGE_STATE(AfxGetStaticModuleState()) int kkkkkkkk=0; INT booklet1 = 1; INT Pages1 = 0; INT m_FileID = ::InitUMFFile(szFilePathName);//Insert Breakpoint; ........... } I found the value is as follows kkkkkkkk 18072928 booklet1 -858993460 Pages1 -858993460 why ???? I am really puzzled. I added someting in stdafx.h #include <queue> #include<stack> using namespace std; "zhang" <makefriend8@163.com> д����Ϣ����:u1SbT%23FbHHA.4656@TK2MSFTNGP03.phx.gbl... > It's a dll support MFC ...

CRM API: Converting an Object Type value -> ObjectType
I've setup post callouts in CRM which notify me when a CRM object has been modified. CRM sends me the ObjectType value so I know what type of object has been modified. For example 1 for an Account, 132 for an Activity... I can't figure out however how to convert the number back into an ObjectType. In theory it should be very simple, but from what I can tell the ObjectType class is NOT an Enum, oddly enough. I've tried the following: int objectTypeValue = 2; // which is a Contact // returns otActivity test = (ObjectType) Enum.ToObject(typeof(ObjectType), objectTypeValue); // r...

doc size limitations
Version: 2008 Operating System: Mac OS X 10.4 (Tiger) Processor: Power PC why are doc sizes limited to printer settings? i like to do floor plans and can never do an entire floor, just room by room. if i shrink things to 1/4 of the original dimensions, zooming in just makes things less sharp. is there any way to enlarge my doc size that i'm not seeing and save it as a custom setting? <br><br>e.g., i want to do six rooms, including bath, in a 32'X28' area. i can work with these dimensions with in a 1:12 ratio, but i can't customize the paper size to, say, 35...

Rehoming public folders Exch5.5
Hi, Iinstalled a new Exch5.5 Serv into our existing site and decided to rehome public folders using Admin console and MS Article Q185043. Serv1 NT4SP5 Exch5.5SP4 is to removed from site Serv2 is the new server Win2kSP3 Exch5.5SP4. My question is why do all my public folders (hidden view) still show in the recipent container on serv1 after being rehomed 5 days a go to serv2 but under the public folder hierarchy all my folder properties state the home server as Serv2? The only step i havn't perform in the article is 'propagate these properties to all subfolders' and clear all optio...

File Size #5
I have a file I have been creating recently in Excel and the size of the file is just HUGE. It has about 10 tabs currently and it is about 3.6MB in size. I have also seen another excel file created by someone else that has 28 tabs (both files are training logs so the amount of data in his worksheets seems to be similar) but his file is only about 1.2MB in size. Are there any tips or tricks to reducing the size of a file? Thanks Jeff Hi Jeff! Here's a few tips. Others will no doubt add more. Delete unused rows and columns after the end of your data. Excel doesn't necessa...

Opens to Personel Folder by default...How to Change?
I cant seem to find a setting anywhere that will let me change Outlook 2003 to open right up to the Inbox. It keeps going to the Personel Folder....Even right after a clean install....Anyone I know that uses Outlook never had to set anything and it always went straight to the Inbox. Any one know how to change this?? THANKS! Darren, Outlook toolbar: Tools/Options/Further/extended options/Folder with program start Do you search this setting? -- Oliver Vukovics Outlook Network without exchange: Public OutLook Share your Outlook PST with several users! http://www.outlookstore.com &...

How can I change order of pages in a fold brochure in publisher
When I work on the pages on the screen it shows pages 2 & 3 and the page preview shows 2 & 3 but when I go to print page 3 comes out as page 5. Is your publication setup as a booklet? When you go to print are you checking current page or typing the page number? What version Publisher are you using? "JudieM" wrote: > When I work on the pages on the screen it shows pages 2 & 3 and the page > preview shows 2 & 3 but when I go to print page 3 comes out as page 5. "Mary Sauer" wrote: > Is your publication setup as a booklet? When you go to prin...