在perl中获取父文件夹中的所有子文件夹 [英] Get all the sub-folders in the parent folder in perl
本文介绍了在perl中获取父文件夹中的所有子文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
有什么方法可以检查父文件夹中是否存在任何子文件夹.我想在Perl中执行此操作吗?
Hi
Is there any way to check whether there is any subfolder exist inside a parent folder. I would like to do this in Perl?
推荐答案
http: //perlmeme.org/faqs/file_io/directory_listing.html [ ^ ]
还
http://perldoc.perl.org/functions/readdir.html [ http://perldoc.perl.org/functions/opendir.html [
http://perlmeme.org/faqs/file_io/directory_listing.html[^]
Also
http://perldoc.perl.org/functions/readdir.html[^]
http://perldoc.perl.org/functions/opendir.html[^]
使用File :: Find;
或
#find/parent/directory/-type d
我的@dirs = split(/\ n/,`find/from/this/place/on -type d`);
use File::Find;
OR
#find /parent/directory/ -type d
my @dirs = split(/\n/,`find /from/this/place/on -type d`);
这篇关于在perl中获取父文件夹中的所有子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文