Rex icon indicating copy to clipboard operation
Rex copied to clipboard

is_dir() inconsistencies

Open felin-arch opened this issue 12 years ago • 2 comments

While using is_dir() (is_file() is probably also affected), I came across a certain behavior, which may not be desired. I was checking a directory on the remote server and it returned false. After looking through the code, I saw it was checking whether the target object can be opened as a directory, which required my user to have permissions on it. Since my user lacked these permissions, the is_dir() call returned false, even if the target object was a directory in all its glory.

I can see how this could make sense, however it yields false results, hence I propose either changing the checking mechanism to reflect the correct state or renaming the functions.

felin-arch avatar Jul 17 '14 08:07 felin-arch

Hi,

thank you for the information. I think (in this case) the is_dir() function should return true.

I will take a look at it.

Cheers,

Jan

krimdomu avatar Jul 17 '14 14:07 krimdomu

I think it can be fixed similarly to the example in Net::SFTP::Foreign documentation.

ferki avatar Jul 19 '14 17:07 ferki