[Bioc-devel] Windows, normalizePath(), and non-ASCII characters

Obenchain, Valerie V@lerie@Obench@in @ending from Ro@wellP@rk@org
Thu May 31 20:09:55 CEST 2018

Hi Mike,
Is this still an issue or has it been resolved?

On 05/22/2018 02:19 PM, Mike Smith wrote:

In trying to diagnose this issue at
https://support.bioconductor.org/p/108548/ I've found some weird behaviour
with Windows, normalizePath(), and non-ASCII characters.  Essentially, if I
run normalizePath() recursively on a path that contains  '�' (I haven't
tried other characters) something 'changes' in the string, but I can't work
out what, and it breaks a subsequent .Call() which uses the path.

The example below tries to demonstrate this in a fairly concise manner. It
works fine if normalizePath() is run once, but fails after it's run a
second time on itself.

However, change "�xample" for "example" and both instances work. Similarly,
both run fine on my Linux machine with the non-ASCII character inplace.

I'd be grateful if anyone else with a Windows machine could verify this
behaviour, or to shed any light on what might be the difference between path1
and path2 below.



## setup some HDF5 components required later
flags <- rhdf5:::h5checkConstants("H5F_ACC", h5default("H5F_ACC"))
fcpl <- rhdf5:::h5checktypeAndPLC(NULL, "H5P_FILE_CREATE", allowNULL = TRUE)
fapl <- rhdf5::H5Pcreate("H5P_FILE_ACCESS")

## create a folder with non-ASCII character

## create two normalized paths recursively - these are 'identical'
path1 <- normalizePath('test.h5', mustWork = FALSE)
path2 <- normalizePath(path1, mustWork = FALSE)
identical(path1, path2)

## create an HDF5 file using path1 - this works
fid <- .Call("_H5Fcreate", path1, flags, fcpl using ID, fapl using ID,
             PACKAGE = "rhdf5")
.Call("_H5Fclose", fid, PACKAGE = "rhdf5")

## create an HDF5 file using path2 - this fails
fid <- .Call("_H5Fcreate", path2, flags, fcpl using ID, fapl using ID,
             PACKAGE = "rhdf5")
if(exists('fid2')) {
  .Call("_H5Fclose", fid2, PACKAGE = "rhdf5")

## tidy up

        [[alternative HTML version deleted]]

Bioc-devel using r-project.org<mailto:Bioc-devel using r-project.org> mailing list

This email message may contain legally privileged and/or confidential information.  If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited.  If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.
	[[alternative HTML version deleted]]

More information about the Bioc-devel mailing list