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

RunCPM can't execute COM file that's definitely there -- filename case issue? #204

Open
Kroc opened this issue Feb 8, 2025 · 13 comments
Open

Comments

@Kroc
Copy link

Kroc commented Feb 8, 2025

The filenames are lowercase on the filesystem, but whilst RunCPM cannot list the files, it can't execute them regardless of case typed!

Image

@MockbaTheBorg
Copy link
Owner

MockbaTheBorg commented Feb 9, 2025

I see it happens on Linux (maybe Mac also, and others).
I wonder ... if we have 'xpto.COM', 'XPTO.com' and 'xpto.com' in the same folder, which are perfectly fine Linux names, which one should RunCPM execute when you type XPTO?
The answer is: none! because none of them are XPTO.COM.
Specifically for this situation I had added the following to our readme:
All the letters for folders/subfolders and file names should be kept in uppercase, to avoid any issues of case-sensitive filesystems compatibility.
I can´t prevent the underlying operating system to give me all the names when I scan its directories.
So in this case I suggest just use uppercase across the board.
We can call it a filesystem "limitation".

@Kroc
Copy link
Author

Kroc commented Feb 9, 2025

Okay, that's fair but I wish I had a choice of uppercase vs. lowercase. Perhaps if a file doesn't exist in the all-uppercase form, check for the all-lowercase form?

@SEGStriker
Copy link

What if the subdirectory has both upper and lower characters, for example ProgAll? So, no way for such a smart check.

@Kroc
Copy link
Author

Kroc commented Feb 9, 2025

It wouldn't have to handle all possibilities -- just ALL CAPS and all lower as the two predominate styles.

@SEGStriker
Copy link

I would say that one of predominate styles is to have capital letter at the beginning. Which means it depends on the logic.

@MockbaTheBorg
Copy link
Owner

I will actually see if I can make it use the first one. Doesn't matter caps combination.
Then it becomes up to us to prevent duplicates.
But it would ignore case.
I think this would be the best behavior.

@feilipu
Copy link

feilipu commented Feb 10, 2025

Just to point out the obvious, the repo is RunCPM. Allowing lowercase would make it RunSomethingLikeCPMish.

CPM expects all uppercase filenames, and many original utilities rely on this. So imho, keep to the standard of CPM 2.2 or later. 2 cents.

@Kroc
Copy link
Author

Kroc commented Feb 10, 2025

Nothing changes within the CP/M environment, this would be entirely a convenience on the host side

@MockbaTheBorg
Copy link
Owner

MockbaTheBorg commented Feb 10, 2025 via email

@SEGStriker
Copy link

On the host side it is fully OS dependent - DOS/Windows doesn't really care about the case (Windows can use both upper and lowercase in file names, but still doesn't really care). Simple example:

C:>dir f*
Volume in drive C is OS

Directory of C:\

01/22/2025 04:45 PM

Files
0 File(s) 0 bytes
1 Dir(s) 229,678,669,824 bytes free

C:>dir F*
Volume in drive C is OS

Directory of C:\

01/22/2025 04:45 PM

Files
0 File(s) 0 bytes
1 Dir(s) 229,678,620,672 bytes free

As shown, it will find "Files" in both cases, even though it contains one capital letter and the rest are lowercase. Same in more complex situations.
But in Linux it is completely the opposite - it really cares about upper/lowercase. So in theory we could have /Files, /files and /FILES in one directory:

[root@server]# mkdir files
[root@server]# mkdir Files
[root@server]# mkdir FILES
[root@server]# ls -la
total 5
drwxr-xr-x 6 root root 99 Feb 10 01:39 .
dr-xr-x---. 17 root root 4096 Dec 12 20:09 ..
drwxr-xr-x 2 root root 6 Feb 10 01:39 files
drwxr-xr-x 2 root root 6 Feb 10 01:39 Files
drwxr-xr-x 2 root root 6 Feb 10 01:39 FILES

This is a real test, not just manipulation :)
So, how will RunCPM distinguish these 3 directories if all of them exist and are converted by the emulator to uppercase?

@MockbaTheBorg
Copy link
Owner

MockbaTheBorg commented Feb 10, 2025 via email

@SEGStriker
Copy link

Yeah, it is same with files. Directories are nothing else but special kind of files, you know that.
OK, whatever you decide.

@MockbaTheBorg
Copy link
Owner

MockbaTheBorg commented Feb 10, 2025 via email

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

4 participants