gen-files
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:1k
- #!/usr/bin/perl -w
- #
- # Generate a list of all files under the current directory and dump them
- # to console in the format required by FILES
- use strict;
- sub listdir {
- my ($curdir) = @_;
- my ($f);
- # We can only handle plain files and directories
- foreach $f (glob("*")) {
- # Don't go into CVS directories
- next if ($f eq "CVS");
- next if ($f =~ /~$/);
- next if ($f eq "autoconf.h");
- next if ($f =~ /.o$/);
- if (-d $f) {
- # Recurse all directories with a depth-first traversal
- chdir("$f");
- if ($curdir ne ".") {
- listdir("$curdir/$f");
- } else {
- listdir("$f");
- }
- chdir("..");
- } else {
- # Print a plain file to console
- if ($curdir ne ".") {
- printf "ns-2.33/$curdir/$fn";
- } else {
- printf "ns-2.33/$fn";
- }
- }
- }
- }
- listdir(".");
- exit 0;