OpenFileRequester: Add checking that file exists
Posted: Wed Apr 26, 2017 9:42 am
Currently, OpenFileRequester() doesn't carry out any sanity checks. The end user can manually type the name of a non-existing file.
So it falls back on the programmer to check that the actual filename returned exisists.
Since the purpose of this requester is to allow the user to choose a file (ie: an existing file) it would make sense that this command checks that the string of the selections corresponds to an actually existing file.
It should still accept an empty string as a cancel operation, but it might make sense that if the string doesn't match an existing file name the requester doesn't close --- ie: the user has to either chose an existing file or cancel the operation, no compromises.
This would spare programmers from having to implement sanity checks on the user choice.
So it falls back on the programmer to check that the actual filename returned exisists.
Since the purpose of this requester is to allow the user to choose a file (ie: an existing file) it would make sense that this command checks that the string of the selections corresponds to an actually existing file.
It should still accept an empty string as a cancel operation, but it might make sense that if the string doesn't match an existing file name the requester doesn't close --- ie: the user has to either chose an existing file or cancel the operation, no compromises.
This would spare programmers from having to implement sanity checks on the user choice.