Re: [hatari-devel] GEMDOS filename handling |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi,
(Sorry again for long delay in answering.)
On lauantai 16 elokuu 2014, Max Böhm wrote:
> > I'm going to look into having correct TOS error codes /
> > mapping for invalid characters and doing conversions in
> > fewer places (higher in call hierarchy).
>
> ok. Some comments for consideration:
>
> 1. The OSX UTF-8 normalization calls (Str_DecomposedToPrecomposedUtf8)
> may be wrapped by #ifdefs __MACOSX__.
Is there some reason why similar UTF-8 strings couldn't be encountered
on other operation systems?
> 2. The setlocale() call which is invoked on Windows may need attention as
> it changes the behaviour of toupper/tolower. When toupper/tolower is
> applied to TOS paths this may not result in the desired outcome for
> characters above 0x80.
Right, this will need its own, Atari charset specific upper/lower
functions to str.c.
> 3. When a file is accessed, the match_host_dir_entry() function in
> gemdos.c does an opendir()/readdir() for each path component to
> accomplish case insensitive filename matching. As a performance
> improvement one could test for existance of the filename in lowercase or
> uppercase first.
Just for the whole path (with Atari HD root replaced with
GEMDOS emu root dir and path separators converted first)?
Good idea. Probably best to do that based on
ConfigureParams.HardDisk.nGemdosCase setting.
> 4. The semantics of path clipping and matching filenames using wildcards?
> I think it may not be expected that the emulator overwrites hostfiles
> files in some situations. For example if "atari.log-save" exists on the
> host it will silently be overwritten when the emulated system creates
> a new file "atari.log" which does not yet exist.
What you describe, works as expected, file names get mapped in both
Atari<->host directions.
1. TOS doesn't have files like "atari.log", TOS file names are uppercase.
Host "atari.log" file being overwritten when Atari program creates
"ATARI.LOG" file is exactly the same problem. Unlike FAT, most
file systems are case-sensitive.
2. You see on Atari side "atari.log-save" as "ATARI.LOG" and when you drag
it into GEM desktop Trash, you do expect it to be removed.
Other alternative is not doing any mapping and showing on Atari side
just those host files which names are fully upper case and fit into 8.3.
However, this would make interchanging files between Atari<->host
awkward and remove most of the reason for GEMDOS HD emulation.
You could as well be using floppy and HD image files...
> (I know it is because the system uses
> wildcards and tries to match the name against atari.log* in such cases).
- Eero