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

readrnx fails silently on windows with file path separator being "/" #10

Closed
HellOwhatAs opened this issue Dec 9, 2024 · 3 comments
Closed

Comments

@HellOwhatAs
Copy link

Hello! Thank you so much for developing such an helpful project.

I encountered a problem, when the path separator is "/" on Windows, the readrnx read nothing.

I believe the issue lies in the expath function. On Windows, this function only accounts for '\\' as the path separator.

if ((p=strrchr(path,'\\'))) {

Currently, running the examples on Windows does not load any data and does not generate any warnings or errors.
When the path separator is changed from / to \\, the examples run as expected.

@ebhrz
Copy link
Contributor

ebhrz commented Dec 10, 2024

Hi, thanks for your issue. You are right. Several people have pointed out this problem. Because at first this lib is developed on linux, windows support is newly added. Indeed I should add a platform check in the example code to determine and replace the path separator. I'll fix it on weekend.

@ebhrz
Copy link
Contributor

ebhrz commented Dec 29, 2024

Hi @HellOwhatAs , I add below codes to detect system:

if os.name == 'nt':
    # if windows, use \\ as path separator
    files = [file.replace('/', '\\') for file in files]

see the changes at f483d9e#diff-cf3ac9cb64b0e16f4f46910577c7e2c1e0937f0ecb19ff98937d32947fe342e8R73-R77

@HellOwhatAs
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants