从任何存在位置的不同文件夹中读取带有扩展名的文件 [英] reading a file with extension from different folders where ever it exists

查看:85
本文介绍了从任何存在位置的不同文件夹中读取带有扩展名的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们

我的文件名带有ext< filename._pod>
这样的扩展文件位于目录的不同文件夹中.
我想读取filename._pod并从不同文件夹中的目录中获取所有文件的大小和总数* ._ pod文件.

示例

Dir_12是目录
在Dir_12中,文件夹A1,B1,C1,D1,E1在那里
在A1文件夹中的xyz._pod文件中.
在B1文件夹中的poq._pod和lmn._pod文件中.
C1文件夹中没有文件
在D1中,那里有abc._pod和def._pod文件.

现在我想知道8._pod文件的总数,还有大小.

请在这个
帮助我
在此先感谢

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

推荐答案

请参见此示例.
http://www.cplusplus.com/forum/beginner/9173/ [
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.


这篇关于从任何存在位置的不同文件夹中读取带有扩展名的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆