Discussion:
KEGS' DynaPro feature drops trailing periods in filenames.
(too old to reply)
Brian Patrie
2022-06-09 04:55:39 UTC
Permalink
I use trailing periods in ProDOS filenames from time to time (usually to
indicate that something has been modified from it's original form); but,
on a DynaPro mounted directory, odd things happen, and they ultimately
get dropped.

My current main usage of DynaPro is for using a host-native text editor
to edit text files; so it's only a minor inconvenience. But it would be
nice to see it eventually fixed.

It would also be nice if at least some of the ProDOS permission bits
were preserved somehow. But again, i can live with it as is for now; so
no rush.

:)

I'm using KEGS v1.16, under Linux Mint, btw.
Kent Dickey
2022-06-13 14:27:07 UTC
Permalink
Post by Brian Patrie
I use trailing periods in ProDOS filenames from time to time (usually to
indicate that something has been modified from it's original form); but,
on a DynaPro mounted directory, odd things happen, and they ultimately
get dropped.
My current main usage of DynaPro is for using a host-native text editor
to edit text files; so it's only a minor inconvenience. But it would be
nice to see it eventually fixed.
It would also be nice if at least some of the ProDOS permission bits
were preserved somehow. But again, i can live with it as is for now; so
no rush.
:)
I'm using KEGS v1.16, under Linux Mint, btw.
This was an unfortunate bug in KEGS caused by the routine trying to legalize
names from your host Linux system to be valid ProDOS names.

When a character which is not valid for ProDOS was found in the native
name (say, en emoji, a space, anything other than A-Za-z0-9 or .), KEGS
would convert that character to a '.' in the ProDOS name.

So a name like "file (9)" would become "file..9.". So then KEGS tried to
eliminate '.'s at the end of the filename since they weren't useful, to
create "file..9" in this example.

But: if the native name already had a dot at the end, this was a legal
ProDOS name, but KEGS was still tossing it. So "TRY1." would be changed
to "TRY1". This is the bug you found.

I just made the step for converting unknown characters to '.' remember which
ones were real '.'s and which ones are converted characters, so "TRY1."
stays "TRY1." but "file (9)" becomes "file..9" still.

I'm not sure when the next KEGS release will be. If you want an immediate
fix and can recompile, edit dynapro.c around lines 1369-1372 to remove these
lines:

while((outpos >= 0) && (g_dynapro_path_buf[outpos-1] == '.')) {
outpos--;
g_dynapro_path_buf[outpos] = 0;
}

This the code removing the trailing '.' from the end of the filename, and
it's what's causing your problem. Without this code, native name "file (9)"
will become "file..9.", but that's not really a problem.

Kent
Brian Patrie
2022-06-15 08:55:48 UTC
Permalink
If you want an immediate fix and can recompile, edit dynapro.c
while((outpos >= 0) && (g_dynapro_path_buf[outpos-1] == '.')) {
outpos--;
g_dynapro_path_buf[outpos] = 0;
}
This the code removing the trailing '.' from the end of the
filename, and it's what's causing your problem. Without this
code, native name "file (9)" will become "file..9.", but that's
not really a problem.
Excellent! Thanks! :)
And, of course, i named the modified version "xkegs-1.16." ;)

Loading...