Update ShellOpen to handle versioned files; add ShellOpen into SEE-PDF in place of MacOS-specific open. #1410
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the issue where ShellOpen did not work with versioned files because the .
Nat the end of versioned files (on the unix filesystem) interfered with the openers' attempt to determine filetype based on the extension.ShellOpen handles versioned files as follows:
filename~<version>~.extension
. Examplefoo.pdf;3
becomesfoo~3~.pdf
. The file is then opened from this tmp file.I was not able to use Ron's suggestion of
foo\;3.pdf
since it cause too many issues on several platforms - including in using COPYFILE inside Medley.Also, could not use symbolic links instead of copying the file to /tmp since symbolic links don't work well with WSL (wslview) and Cygwin (cygstart).
This PR also fixes PDF-SEE to use ShellOpen instead of the MacOS-specific open.
Tested on WSL, Ubuntu Linux, MacOS, and Cygwin.