Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement cross-platform path support (for .conf, .cue files) #102

Closed
dreamer opened this issue Dec 22, 2019 · 1 comment · Fixed by #674
Closed

Implement cross-platform path support (for .conf, .cue files) #102

dreamer opened this issue Dec 22, 2019 · 1 comment · Fixed by #674
Assignees
Labels
enhancement New feature or enhancement of existing features

Comments

@dreamer
Copy link
Member

dreamer commented Dec 22, 2019

Windows-only paths used in .conf and .cue files are a major source of headaches for DOSBox users - it makes it impossible for .conf/.cue files written on Windows to be usable on other platforms (and also the other way around - it is possible to write .conf file usable on Linux, but unusable on Windows).

The solution to this is quite simple:

  • convert Windows-paths to point to files on Linux filesystem; in general case it can't be done 100% reliably, but for DOS games (where original files are all case-insensitive already), it certainly can. Test implementation was already written for Boxtron in Python and can be found here: winpathlib.py
  • for Linux->Windows - display warning/error whenever .conf file refers to path that is impossible on Windows (e.g. the paths including : character).
  • use above-mentioned conversion in following features:
    • path to filesystem passed to MOUNT
    • path to file passed to IMGMOUNT
    • path to individual files in .cue file used for imgmounting

There is one prerequisite though: before implementing this, we need to have framework for unit testing, otherwise it will be hard to handle all corner cases without regressions.

@dreamer dreamer added the enhancement New feature or enhancement of existing features label Dec 22, 2019
@dreamer dreamer self-assigned this Dec 22, 2019
@dreamer dreamer added this to New features in Backlog via automation Mar 28, 2020
@dreamer dreamer removed this from Suggested new features in Backlog Oct 7, 2020
@dreamer dreamer added this to In progress in 0.76.0 release Oct 7, 2020
@dreamer
Copy link
Member Author

dreamer commented Oct 7, 2020

To quote from other issue:

I have proof of concept ready and so far it works on all GOG games I threw at it (Mortal Kombat 3, Tomb Raider, Carmageddon - all games use CUE+something, except .CUE is named .DAT or .INS and .BIN is sometimes named .GOG and paths inside are windows-only and case-insensitive.

Solution translates windows path separators to linux path separators (in one additional place the translation was missing earlier) and converts case-insensitive paths to case-sensitive ones using POSIX glob function (all paths in CUE files and all paths passed to imgmount command).

New functions I implemented will need to be adjusted to work differently on Windows (and perhaps slight modification for macOS will be necessary).

Branch po/fs-utils-2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement of existing features
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant