Skip to content
New issue

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

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

Already on GitHub? # to your account

external file path formatting tied to OS #106

Open
kallejahn opened this issue Jan 14, 2025 · 0 comments
Open

external file path formatting tied to OS #106

kallejahn opened this issue Jan 14, 2025 · 0 comments

Comments

@kallejahn
Copy link

When fileio.setup_external_filepaths() saves the external file paths, it is formatting based on the OS. I create models on Windows, but then often run them on Linux, so that is creating backslash issues.

I've added .replace('\\','/') on lines 509 and 513 in fileio.py as a fix, but not sure if that's what you'd want long term?

    if not relative_external_paths:
        external_files = [os.path.normpath(os.path.join(model.model_ws,
                                       model.external_path,
                                       filename_format.format(i))).replace('\\','/') for i in file_numbers]
    else:
        external_files = [os.path.join(model.model_ws,
                                       model.external_path,
                                       filename_format.format(i)).replace('\\','/') for i in file_numbers]
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant