"Shishir K. Singh" wrote: > don't think there is a way to get the full path. The only way I can think of is by >concatening the results of the readdir with the $path that you used for opening the >directory.
perldoc -f glob print while (<$your_src_dir/*>); This will print all the files with $your_src_dir prefixed to it. This will not be the absolute path if $your_src_dir is relative to your cwd. > > > > > -----Original Message----- > From: Torres, Jose [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 29, 2002 10:41 AM > To: '[EMAIL PROTECTED]' > Subject: RE: iterating over the contents of a directory > > Thanks for your help everyone. I had a related question. It looks like > readdir just return relative filenames and not absolute ones. Is there a > way/method to return absolute filenames? For example, if I'm in /home/docs > that has a text file (foo.txt) and I call readdir, I want to return > /home/docs/foo.txt instead of just foo.txt. I could theoretically just > append foo.txt to a "/home/docs/" prefix, but I'm trying to make my code > more generic and not hard-code everything if possible. Thank you. > > -Jose > > -----Original Message----- > From: Nikola Janceski [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 29, 2002 10:27 AM > To: Torres, Jose; '[EMAIL PROTECTED]' > Subject: RE: iterating over the contents of a directory > > check out opendir readdir and closedir. > > > -----Original Message----- > > From: Torres, Jose [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, May 29, 2002 10:23 AM > > To: '[EMAIL PROTECTED]' > > Subject: iterating over the contents of a directory > > > > > > Hi, > > > > How can I simply iterate over the contents of a directory? I > > want to perform > > a certain > > action when I locate a particular text file. Thanks. > > > > > > > > -Jose > > > > -- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > ---------------------------------------------------------------------------- > -------------------- > The views and opinions expressed in this email message are the sender's > own, and do not necessarily represent the views and opinions of Summit > Systems Inc. > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
