[Rd] non portable filenames

Kasper Daniel Hansen kasperdanielhansen at gmail.com
Mon Aug 27 15:58:57 CEST 2012


I am including an external piece of software in an R package.  This
software ships with its own configure script generated by
autoconf/automake, and this script is being run as part of the package
configure script.

The package contains a file
  m4/lt~obsolete.m4
which - as far as I can see - is a standard file from the
autoconf/automake/m4 suite of programs.  A warning is generated with R
CMD check about this filename being non-portable.  Presumably because
of the "~" in the file name.  The users is referred to the 'Package
structure' part of R-exts.

Reading the manual, I do not see "~" listed in the beginning of the
paragraph where non-allowed characters are described.  Quoting:

"To ensure that file names are valid across file systems and supported
operating system platforms, the ASCII control characters as well as
the characters ‘"’, ‘*’, ‘:’, ‘/’, ‘<’, ‘>’, ‘?’, ‘\’, and ‘|’ are not
allowed in file names. In addition, files with names ‘con’, ‘prn’,
‘aux’, ‘clock$’, ‘nul’, ‘com1’ to ‘com9’, and ‘lpt1’ to ‘lpt9’ after
conversion to lower case and stripping possible “extensions” (e.g.,
‘lpt5.foo.bar’), are disallowed. Also, file names in the same
directory must not differ only by case (see the previous paragraph).
In addition, the basenames of ‘.Rd’ files may be used in URLs and so
must be ASCII and not contain %."

However, "~" is also not part of the next sentence where allowed
characters are listed.  Quoting

"For maximal portability filenames should only contain only ASCII
characters not excluded already (that is A-Za-z0-9._!#$%&+,;=@^(){}'[]
— we exclude space as many utilities do not accept spaces in file
paths): non-English alphabetic characters cannot be guaranteed to be
supported in all locales. It would be good practice to avoid the shell
metacharacters (){}'[]$."

To me it looks a bit like this paragraph is not self-consistent, since
"~" is not listed as one of the characters already excluded.

Now, I don't really know if "~" is portable.  But I assume that the
autoconf/automake/m4 people has thought a bit about this.  And I don't
really want to rename the file in question, as it is part of a lengthy
configure script.  So I guess my question is, is R CMD check correct
in flagging the file?  And what is recommended?  I am tempted to
ignore this warning, but I know warnings sometimes become errors.

I assume other people might be in the same situation, since the
filename originates from autoconf/automake/m4.

Kasper



More information about the R-devel mailing list