Bug 16270 - choose.files returns erroneous characters after second invocation when multi=FALSE (in R 3.1.3)
Summary: choose.files returns erroneous characters after second invocation when multi=...
Alias: None
Product: R
Classification: Unclassified
Component: I/O (show other bugs)
Version: R 3.1.2
Hardware: x86_64/x64/amd64 (64-bit) Windows 64-bit
: P5 normal
Assignee: R-core
Depends on:
Reported: 2015-03-19 13:42 UTC by Carl Finkbeiner
Modified: 2015-05-01 01:17 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Carl Finkbeiner 2015-03-19 13:42:11 UTC
NOTE - this just started happening in version 3.1.3.

Type "choose.files()" and in the ensuing dialog, select one file from whatever directory shows up, but make sure it is a file with a longer name than other files in that directory. Note the character string that is returned.  Then, type "choose.files()" again, this time selecting a file with a shorter name than the one you chose first.  Note that the returned character string is correct for whatever you selected.

Now repeat the above process, but this time type "choose.files(multi-FALSE)" each time, and again selecting a file with a longer name the first time, and a shorter name the second time.  You will see that the second time, the character string is correct up to the end of the shorter file name, but then it contains additional characters left over from the first, longer file name".  This is obviously the wrong characters to return.

Clearly, I can work around this by using the default for multi (which is TRUE), but I rather wanted to protect the user from mistakenly selecting more than one file in the application I am developing.
Comment 1 Duncan Murdoch 2015-05-01 01:17:15 UTC
This should be fixed in R-devel and R-patched as of revision 68289.