如何读取目录中的子目录列表 [英] How To Read a List of subdirectories in a Directory

查看:90
本文介绍了如何读取目录中的子目录列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想读取perl中数组中所有子目录的列表。我知道如何获取目录中所有文件的列表,但它没有显示该列表中的子目录。


可以帮助解决这个问题。

先谢谢。


Fanee G.

解决方案


大家好,


我想读取perl中数组中所有子目录的列表。我知道如何获取目录中所有文件的列表,但它没有显示该列表中的子目录。


可以帮助解决这个问题。

先谢谢。


Fanee G.



你会想看一下< a rel =nofollowhref =http://search.cpan.org/~tommy/File-Util-3.22/Util.pod#list_dirtarget =_ blank> File :: Util 模块开启CPAN。有一个list-dir功能。它有一个选项,只能列出目录中的目录。


问候,


杰夫


< blockquote>


大家好,


我想读取perl中数组中所有子目录的列表。我知道如何获取目录中所有文件的列表,但它没有显示该列表中的子目录。


可以帮助解决这个问题。

先谢谢。


Fanee G.



发布您正在使用的代码。

这是我正在使用的代码。


我也尝试过File-Util。但是当用ppm搜索时,这不适用于windows。


我尝试使用nmake编译它但是它们有很多错误。


这是我用来查找文件列表的代码。


@files =< *> ;;

foreach

Hi ALL,

I want to read list of all subdirectories in an array in perl. I know how to get a list of all files in a directory but it does not show subdirectories in that list.

Can any help out on this issue.
Thanks in advanced.


Fanee G.

解决方案

Hi ALL,

I want to read list of all subdirectories in an array in perl. I know how to get a list of all files in a directory but it does not show subdirectories in that list.

Can any help out on this issue.
Thanks in advanced.


Fanee G.

You will want to take a look at the File::Util module on CPAN. There is a function for "list-dir" that has an option to it to only list directories in a directory.

Regards,

Jeff


Hi ALL,

I want to read list of all subdirectories in an array in perl. I know how to get a list of all files in a directory but it does not show subdirectories in that list.

Can any help out on this issue.
Thanks in advanced.


Fanee G.


post the code you are using.


This is the code I am using.

I have also tried File-Util. But this is not available for windows when searching by ppm.

I tried to compile it using nmake but their are lot of errors.

This is the code i am using to find file list.

@files = <*>;
foreach


这篇关于如何读取目录中的子目录列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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