[R] list.files() not compatible with all Unicode characters; file.exists() is compatible.

Nissim Kaufmann nissimkaufmann at yahoo.com
Mon Nov 24 20:07:51 CET 2014


Hello,I have some files with strange Unicode characters in their names that I am trying to remove.But list.files() does not return their names faithfully so that I can deal with them.
> list.files()[1] "? text.txt"                  <--- here you should see a question mark, a space, then text.txt> file.exists("? text.txt")    <----by copying and pasting the output from above[1] FALSE> file.exists('▶ text.txt')    <--- here you should see a black triangle, what looks like a space, and text.txt[1] TRUE
Documentation for file.exists() and file.access() do not seem to discuss this.
The file name has these Unicode characters:BLACK RIGHT-POINTING TRIANGLE WITH DOUBLE VERTICAL BAR U+23EF BLACK RIGHT-POINTING TRIANGLE WITH DOUBLE VERTICAL BAR ⏯BLACK RIGHT-POINTING TRIANGLE U+25B6 BLACK RIGHT-POINTING TRIANGLE ▶
Thank you!CheersNissim KaufmannNSOL.altervista.org
	[[alternative HTML version deleted]]



More information about the R-help mailing list