Here's the code :
Dir.foreach('C:\\Documents and Settings\\') { |entry|
if File.directory?( entry )
puts entry
end
}
Dir.foreach('\\\\10.80.14.20\\transfer') { |entry|
if File.directory?( entry )
puts entry
end
}
Both C:\\Documents and Settings
and \\10.80.14.20
contain directories. But it only lists the folders under C:\Documents and Settings
. While the folders under \\\\10.80.14.20
isn't listed. It seems File.directory?( entry )
cannot work under shared folders. Am I right? If so, is there any other methods to identify folders when under shared folders?