can some one please help me with an example to list all the directories and their soft-links.
Thanks, Nagesh 2008/3/26 Sandy <[EMAIL PROTECTED]>: > On 26 мар, 07:33, [EMAIL PROTECTED] (Nag) wrote: > > > > I have a parent directory which contains nearly 10 soft-links to other > > directories, the linked directory may also contain soft-links to other > > directories.it goes on like that till the directory doesn't contain any > > soft-links. How can I get the list of all these directories ? Thanks in > > advance > > You can do opendir(), readdir() in the loop and test every entry with > '-l' operator: if (-l $entry) {...}. > perldoc -f -l > Then you can recursively go through all detected linked dirs (test if > they are dirs with '-d' operator). You may want to include a loop > detection logic, so you don't cycle forever if there is a loop > > Do you necessarily need it in Perl? Consider calling 'find' if you are > on Unix. 'man find' for options > > /sandy > http://myperlquiz.com/ > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > http://learn.perl.org/ > > > -- Thanks Nagesh