Bug or undocumented behavior in normalizePath() with file system links on windows

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug or undocumented behavior in normalizePath() with file system links on windows

David Korfkamp
Hello,

I discovered a bug or undocumented behavior in normalizePath

steps to reproduce:

execute normalizePath on a folder link on windows. When you are on a
non-english windows box, you likely have links in place for windows'
default folders, e.g. "C:\Programme" linking to "C:\Program Files" on
german windows boxes.

Thus executing 'normalizePath("C:/Programme/R")' results in an "
path[1]="C:/Programme/R": Access is denied" error while
'normalizePath("C:/Program Files/R")' yields the expected result. Just
executing executing 'normalizePath("C:/Programme")' however also yields
the expected result,

Cheers
David

--
M.Sc. David Korfkamp

OFFIS e.V. - Institut f�r Informatik
FuE Bereich Gesundheit | R&D Division Health
Escherweg 2, 26121 Oldenburg - Germany
Phone/Fax: +49 (0) 441 9722 346 / -111
E-Mail: [hidden email]
URL: http://www.offis.de

Registergericht: Amtsgericht Oldenburg VR 1956
Vorstand: Prof. Dr.-Ing. Wolfgang H. Nebel (Vorsitzender), Prof. Dr.
techn. Susanne Boll-Westermann, Prof. Dr.-Ing. Axel Hahn, Prof. Dr.-Ing.
Andreas Hein, Prof. Dr. Sebastian Lehnhoff
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Reply | Threaded
Open this post in threaded view
|

Re: Bug or undocumented behavior in normalizePath() with file system links on windows

Tomas Kalibera

I think this is caused by insufficient permissions on "C:/Programme"
junction, and the behavior of normalizePath is as documented. I can get
the same error with "C:/Documents and Settings", which is on my machine
a junction into "C:/Users". The path cannot be normalized using
normalizePath(), because my user account does not have read (listing)
permissions for the junction "C:/Documents and Settings". This is
documented in ?normalizePath as one of the reasons for it to signal an
error (and, on Windows, read permissions for a directory are needed for
conversion to long path names). Normalization works fine for both
junctions and symbolic links with sufficient permissions (note that on
Windows, as documented, links are not resolved; on Unix/POSIX they are,
by realpath).

Best,
Tomas

On 1/24/19 3:51 PM, David Korfkamp wrote:

> Hello,
>
> I discovered a bug or undocumented behavior in normalizePath
>
> steps to reproduce:
>
> execute normalizePath on a folder link on windows. When you are on a
> non-english windows box, you likely have links in place for windows'
> default folders, e.g. "C:\Programme" linking to "C:\Program Files" on
> german windows boxes.
>
> Thus executing 'normalizePath("C:/Programme/R")' results in an "
> path[1]="C:/Programme/R": Access is denied" error while
> 'normalizePath("C:/Program Files/R")' yields the expected result. Just
> executing executing 'normalizePath("C:/Programme")' however also yields
> the expected result,
>
> Cheers
> David
>
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel