Click here to Skip to main content
15,898,599 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys

I have a filename with ext <filename._pod>
such extension files are located in different folders in a directory.
i want read filename._pod and get the size of all files and total number *._pod files from the directory which are in different folders.

exmples

Dir_12 is a directory
in Dir_12 , Folders A1,B1,C1,D1,E1 are there
in A1 folder xyz._pod file is there.
in B1 folder poq._pod and lmn._pod file are there.
in C1 folder no files exist
in D1 foler abc._pod and def._pod files are there.

now i want to know total number of 8._pod files and there sizes.

please help me in this

thanks in advance
Posted
Comments
pasztorpisti 15-Aug-12 4:15am    
Mentioning the operating system would be helpful. For example if you write windows specific code then you get the size from the directory entries during iteration, with opendir/closedir posix api you don't necessarily.

1 solution

see this example.
http://www.cplusplus.com/forum/beginner/9173/[^]

There is no way that the directory will be traversed hierachically, that you will have to code yourself. So you have to check if an entry is a directory and then do the same thing again. You have to do recursion to do this smart.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900