I am doing some development with Pacific C under Dosbox, and for portability reasons, I want the source file names to be lowercase. I tried renaming the source files created in the host file system (which works at first), but then the Pacific IDE (or compiler?) regularly seems to rename/re-create files that are edited, which then makes them uppercase in the host file system again.
Dosbox does not rename anything, and it works just fine with lower/mixed-cased file names in the host file system. Files newly created by applications running under Dosbox are created in upper case on the host file system, which is not a problem generally, but in my case the application re-creates the files, thus changing the file name in the host file name (unless it was already uppercase), which is what I am trying to work around.
There can be no general solution here because DOS does not retain case information. The application basically does "rename foobar.c to FOOBAR.BAK, newly create FOOBAR.C". While my workaround prevents "foobar.c" from being re-created as "FOOBAR.C", it would also cause e.g. "FooBar.c" to be re-created as "foobar.c", again changing the file name in the (case-sensitive) host file system.
There can be no general solution here because DOS does not retain case information.
There is case-preserving and case-sensitivity. DOS is not case-preserving. Windows is case-preserving but case-insensitive. Case preserving on FAT partitions is achieved with LFN (long filenames) mechanism, even if the name would otherwise fit in the 8.3 scheme.
With LFN support in DOS (e.g. DOSLFN or a DOSBox fork that supports long filenames) case preserving may work in DOS too.