Patch for rdoc to deal with symbolic links

J

James F. Hranicky

The first will return "link" when rel_file_name is linked to a file,
the second will return "file".

-------------------------------------------------------------
*** rdoc/rdoc.rb.orig Thu Jul 17 11:01:43 2003
--- rdoc/rdoc.rb Thu Jul 17 11:08:34 2003
***************
*** 118,124 ****

relative_files.each do |rel_file_name|

! case type = File.ftype(rel_file_name)
when "file"
file_list << rel_file_name
when "directory"
--- 118,124 ----

relative_files.each do |rel_file_name|

! case type = File.stat(rel_file_name).ftype
when "file"
file_list << rel_file_name
when "directory"
 
D

Dave Thomas

James said:
The first will return "link" when rel_file_name is linked to a file,
the second will return "file".

Thanks (I hadn't realized that File.ftype etc use lstat internally)


Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top