$File::Find and no_chdir



Hi,

I have a UNIX directory $DIR which contains a lot of files and
subdirecotires. Now, I would

like to list all files and subdirectories in $DIR only. That means,
$File::Find should not

go into any subdirectories of $DIR and list the files and
subdirectories there as well.

So far, I have not had any luck with the option no_chdir =>0.



find ( {
no_chdir => 0,
wanted => sub {

print "$File::Find::name\n" ;

}
},
$DIR
);



Any ideas ?

I thank you for your efforts.


Stefan

.



Relevant Pages

  • Re: Searching a filename from multiple workbooks or drives
    ... you need to search the directory tree, including any subdirectories under the ... Sub ListAllFilesInDirectoryStructure() ... Sub ListFilesInDirectory(Directory As String) ... Dim aDirsAs String, iDir As Integer, stFile As String ...
    (microsoft.public.excel.programming)
  • Re: Using VB to rename and move files ?
    ... First build a list of the required subdirectories. ... Dim mFileList As Collection ... Private Sub Command1_Click ...
    (comp.lang.basic.visual.misc)
  • RE: Batch File/Script to Recursively Delete Files and Folders in Subdi
    ... recurse, find all supplied Extensions of the form ... Sub QuitMsg ... Recusively scan subdirectories." ... if AtLeastOne then WScript.StdOut.WriteLine ...
    (microsoft.public.scripting.wsh)
  • Re: Question on how to do a global search and replace
    ... I've looked in the archives for this problem and have tried ... > quite a few different suggestions but so far, no luck. ... The files exist in many directories and subdirectories ... You can do it without the grep, but it's far more efficient with it if not ...
    (comp.unix.solaris)
  • Re: Question about reading a directory
    ... Pit wrote: ... Is there such a fast way to check if a directory contains subdirectories ... but reading the whole directory ... print "'$path' contains subdirectories.\n" if $sub; ...
    (comp.lang.perl.tk)