Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MBASIC lower case file name errors

686 views
Skip to first unread message

PianoMatt

unread,
Aug 1, 2017, 2:12:40 PM8/1/17
to
Afternoon all

I'm new to CP/M, having only recently built a machine capable of running it (the RC2014). I've notioced that if I save a file from mbasic with a lower case file name I can't use "era" to delete it. The file can be loaded into mbasic with no issues but if I try to use era I get "FILE NOT FOUND". Is this a known issue? Is there a workaround for it?

I'm using CP/M 2.2 as provided by Grant Searle, via Spencer Owen at the RC2014 project

Many thanks
PianoMatt

Udo Munk

unread,
Aug 1, 2017, 3:12:15 PM8/1/17
to
This is a known issue and the workaround is using upper case:

B>dir
B: MBAS521 COM : OBASIC COM : STARTREK BAS : RFILE
B: TREKINST BAS : MBAS529 COM : RANTEST BAS
B>
B>
B>mbas521
BASIC-80 Rev. 5.21
[CP/M Version]
Copyright 1977-1981 (C) by Microsoft
Created: 28-Jul-81
34872 Bytes free
Ok
load "startrek.bas"
File not found
Ok
load "STARTREK.BAS"
Ok
system

B>mbas529
BASIC-85 Rev. 5.29
[CP/M Version]
Copyright 1985-1986 ? by Microsoft
Created: 28-Jul-85
34872 Bytes free
Ok
load "startrek.bas"
File not found
Ok
load "STARTREK.BAS"
Ok
system

B>

Udo Munk

unread,
Aug 1, 2017, 3:17:20 PM8/1/17
to
Oh, and if you save a file with lower case you'll have a problem of course ;-)

A>b:
B>mbas521
BASIC-80 Rev. 5.21
[CP/M Version]
Copyright 1977-1981 (C) by Microsoft
Created: 28-Jul-81
34872 Bytes free
Ok
load "STARTREK.BAS"
Ok
save "d:xx.bas"
Ok
system

B>dir d:
D: xx bas
B>era d:xx.bas
NO FILE
B>

Mr. Emmanuel Roche, France

unread,
Aug 1, 2017, 4:25:18 PM8/1/17
to
PianoMatt wrote:

> I'm new to CP/M, having only recently built a machine capable of running it (the RC2014). I've notioced that if I save a file from mbasic with a lower case file name I can't use "era" to delete it. The file can be loaded into mbasic with no issues but if I try to use era I get "FILE NOT FOUND". Is this a known issue? Is there a workaround for it?

I don't know if you have also noticed, but the "line size" of MBASIC is 72 columns.

Both "characteristics" come because MBASIC was designed to be used from a Teletypewriter, in this case an (American) ASR-33 Teletype.

This is also the reason of the use of "control characters" to move the "cursor" (a cylindrical printwheel, or "Carriage", at the origin), rather than "arrow keys" (which did not exist, back then, on keyboards (by the way, the keyboard of the Apple is copied from the ASR-33 Teletype)).

One of the characteristics of the ASR-33 Teletype was that it was upper-case only, so it could not save a file in lower-case.

This is also one reason why filenames, under CP/M, are always written in upper-case ("MBASIC").

Also, when we recreated some old Digital Research source code, some of the older files were upper-case only, meaning: they had been created with an ASR-33 Teletype (in his book, Gary Kildall complains that he used an ASR-33 Teletype during 2 years before finally booting CP/M on his Intellec-8 system).

Well. Let us see... Also, some "logical devices" of CP/M are coming from the ASR-33 Teletype. For instance, the "null device" (NUL:) was the name of the cylinder used to encode the "name" of the ASR-33 Teletype, when used as a "terminal" of the Telex network. That's why the "null device" is generating 40 ASCII NUL bytes (00H): this was the default "name" of an ASR-33 Teletype (from factory) when it had not been given a "name". (Hence the WRU ("Who aRe yoU") of the ASCII code.)

Well... I think that I have answered your question.

Yours Sincerely,
Mr. Emmanuel Roche, France

PianoMatt

unread,
Aug 1, 2017, 5:04:48 PM8/1/17
to
So essentially if I've used lower case file names I'm stuffed then. Are there any utilities out there that can delete these files? OR am I just going to have to live with it?

Mr. Emmanuel Roche, France

unread,
Aug 1, 2017, 5:32:47 PM8/1/17
to
PianoMatt wrote:

> So essentially if I've used lower case file names I'm stuffed then. Are there any utilities out there that can delete these files? OR am I just going to have to live with it?

There are many solutions.

Use an operating system that recognizes lower/upper cases, then delete the lower case files.

Use an "ambiguous file specification" to erase the files.

If you want to have a good understanding of the "file system" of CP/M, I would advice you to learn to use a "disk editor".

The standard, under CP/M, is named DU ("Disk Utility"). Find one of the last versions (there were many, many). The trick is to "map" the circular tracks of the floppy disk with the "square" hex dump displayed by the program.

There are also "screen-based" disk editors. Me, I used SuperZap 3.5, but it needs to be "installed" for a screen. It displays the "Directory" of the floppy disk, then you move the "cursor" (hex byte in reverse (etc.) video) on the screen with the "arrow keys", then patch any byte of the floppy disk (including, of course, the Directory), then save the changes. So, you can change any filename to upper-case, or rename the file, change its "user number", etc.

Must leave. Hope to have answered your question.

Udo Munk

unread,
Aug 1, 2017, 5:36:44 PM8/1/17
to
On Tuesday, August 1, 2017 at 11:04:48 PM UTC+2, PianoMatt wrote:
> So essentially if I've used lower case file names I'm stuffed then. Are there any utilities out there
> that can delete these files? OR am I just going to have to live with it?

You can re-format the disk, after saving the files you want to keep of course. You can use a disk
editor like zap to correct the directory entry to upper case. You can use tools like ERAQ that
ask for every file if you want to delete it, and answer Y only for the bogus ones. Get a copy
of the CP/M CD-ROM, it includes plenty of tools including the mentioned ones. Or if you
are familiar with z80pack, the disk images include tools like zap and the like.

Charles Richmond

unread,
Aug 1, 2017, 5:52:36 PM8/1/17
to
The Walnut Creek CP/M CDROM ISO from 1994 image can be downloaded from:

https://archive.org/details/cdrom-1994-11-walnutcreek-cpm


Selected chunks of the CDROM can be downloaded here:

http://www.classiccmp.org/cpmarchives/cpm/Software/WalnutCD/cpm/

--
numerist at aquaporin4 dot com

Steve Nickolas

unread,
Aug 1, 2017, 6:08:51 PM8/1/17
to
mbasic KILL or NAME command?

-uso.

PianoMatt

unread,
Aug 1, 2017, 6:11:02 PM8/1/17
to
Thanks for the hints guys. I have the multicomp FPGA collection of utilities and Zap 5.2 is included in that. I figured out how to change the file name from lower to upper and I've deleted the files I needed to delete.

Now I know how to fix it without needing to resort to drastic measures like formatting the disk.

Cheers!
PianoMatt

Udo Munk

unread,
Aug 1, 2017, 6:33:14 PM8/1/17
to
On Tuesday, August 1, 2017 at 10:25:18 PM UTC+2, Mr. Emmanuel Roche, France wrote:

> This is also the reason of the use of "control characters" to move the "cursor" (a cylindrical
> printwheel, or "Carriage", at the origin), rather than "arrow keys" (which did not exist, back then,
> on keyboards (by the way, the keyboard of the Apple is copied from the ASR-33 Teletype)).

Here, terminal with arrow keys from 1972, a bit before any 8080 or CP/M existed:

http://terminals-wiki.org/wiki/index.php/ADDS_Envoy_620

John Elliott

unread,
Aug 1, 2017, 7:06:08 PM8/1/17
to
The easiest way to fix it is within MBASIC, since its own internal file
functions are case-sensitive. You could delete it:

KILL "example.bas"

or rename it into upper case:

NAME "example.bas" AS "EXAMPLE.BAS"

--
John Elliott

Thinks: This is what a nice clean life leads to. Hmm, why did I ever lead one?
-- Bluebottle, in the Goon Show

dott.Piergiorgio

unread,
Aug 2, 2017, 4:36:10 AM8/2/17
to
I concur on using a file editor. Occasionally I use a hex editor on CP/M
disk images for removing / from filenames... but I never have issues
from CP/M disk images.

you can also extract the offending file from the disk image, rename it
in all uppercase and put back it on the disk image.

ISTR to have read that the bug is actually a feature of sort, a weak
built-in copy protection method (think about ACCoUNT.BAS, for example)

Best regards from Italy,
dott. Piergiorgio.

Bill

unread,
Aug 7, 2017, 10:40:39 AM8/7/17
to

Did you get my email note?

Bill

- - - -

On Tue, 1 Aug 2017 14:32:46 -0700 (PDT), "Mr. Emmanuel Roche, France"
<roch...@laposte.net> wrote:
......

Fred Weigel

unread,
May 7, 2020, 7:09:26 PM5/7/20
to
Yes, CP/M cannot era lower-case names - but MBASIC can:

If you have saved a file:

SAVE "oops.bas"

with a lower-case name, go back into MBASIC and:

KILL "oops.bas"

to erase it.

FredW

Lyndon

unread,
May 7, 2020, 9:24:03 PM5/7/20
to
The alternative is to use a program NSWEEP or its variation that can erase l/c files, or rename them. Very useful program...

willh...@gmail.com

unread,
May 9, 2020, 1:09:10 PM5/9/20
to
On Thursday, May 7, 2020 at 4:09:26 PM UTC-7, Fred Weigel wrote:
> Yes, CP/M cannot era lower-case names - but MBASIC can:
>
> If you have saved a file:
>
> SAVE "oops.bas"
>
> with a lower-case name, go back into MBASIC and:
>
> KILL "oops.bas"
>
> to erase it.

Seems to me the fundamental issue here is simply that the CCP automatically converts the command line to upper case before it actually executes the command. The BDOS doesn't seem to care about case per se, but since the CCP is driving this, the uppercase requirement sticks. Arguable it's a gap in MBASIC for not uppercasing file names itself before calling the BDOS also.

j...@mdfs.net

unread,
May 20, 2020, 6:26:50 PM5/20/20
to
willh wrote:
> Seems to me the fundamental issue here is simply that the CCP
> automatically converts the command line to upper case before
> it actually executes the command. The BDOS doesn't seem to
> care about case per se, but since the CCP is driving this,
> the uppercase requirement sticks.

A thought occurs, as far as the BDOS is concerned then, is
the file system case sensitive? So you could have fred, Fred
and FRED as distinct files?

jgh

Fred Weigel

unread,
May 20, 2020, 8:45:57 PM5/20/20
to
Interesting thought. But we can easily test this:

10 OPEN "O", #1, "fred"
20 PRINT #1, "file 1"
30 CLOSE #1
40 OPEN "O", #1, "Fred"
50 PRINT #1, "file 2"
60 CLOSE #1
70 OPEN "I", #1, "fred"
80 LINE INPUT #1, S$
90 PRINT S$
100 CLOSE #1
110 OPEN "I", #1, "Fred"
120 LINE INPUT #1, S$
130 PRINT S$
140 CLOSE #1
Ok
run
file 2
file 2
Ok

and then

kill "fred"
Ok
kill "Fred"
File not found
Ok

See? It doesn't actually work. "Fred" is to be the same as "fred"... even
though they are distinct from "FRED".

FredW

Martin

unread,
May 20, 2020, 10:31:22 PM5/20/20
to
Wrong!
Of course, it works!


What is your test environment?
Are you using an emulator without real disk images?
And where is "FRED" in your experiment?


I repeated your tests using mbasic 5.2 running on CP/M 2.2.
I have extended it a little bit, it also tests "FRED".



=========

A>stat *.*

Recs Bytes Ext Acc
191 24k 2 R/W A:MBASIC.COM
41 6k 1 R/W A:STAT.COM
Bytes Remaining On A: 752k

A>mbasic
BASIC-80 Rev. 5.2
[CP/M Version]
Copyright 1977, 78, 79, 80 (C) by Microsoft
Created: 14-Jul-80
35910 Bytes free
Ok
10 OPEN "O", #1, "fred"
20 PRINT #1, "file 1"
30 CLOSE #1
40 OPEN "O", #1, "Fred"
50 PRINT #1, "file 2"
60 CLOSE #1
65 OPEN "O", #1, "FRED"
66 PRINT #1, "file 3"
67 CLOSE #1
70 OPEN "I", #1, "fred"
80 LINE INPUT #1, S$
90 PRINT S$
100 CLOSE #1
110 OPEN "I", #1, "Fred"
120 LINE INPUT #1, S$
130 PRINT S$
140 CLOSE #1
145 OPEN "I", #1, "FRED"
146 LINE INPUT #1, S$
147 PRINT S$
148 CLOSE #1
run
file 1
file 2
file 3
Ok
files
MBASIC .COM STAT .COM fred Fred
FRED
Ok
kill "fred"
Ok
kill "Fred"
Ok
files
MBASIC .COM STAT .COM FRED
Ok
kill "FRED"
Ok
system

A>

========

dxforth

unread,
May 20, 2020, 10:50:57 PM5/20/20
to
> ...

Case-sensitive filenames? Let's not go there :)

Douglas Miller

unread,
May 21, 2020, 9:10:19 AM5/21/20
to
On Saturday, May 9, 2020 at 12:09:10 PM UTC-5, willh...@gmail.com wrote:
>...
>
> Seems to me the fundamental issue here is simply that the CCP automatically converts the command line to upper case before it actually executes the command. The BDOS doesn't seem to care about case per se, but since the CCP is driving this, the uppercase requirement sticks. Arguable it's a gap in MBASIC for not uppercasing file names itself before calling the BDOS also.

I'm not sure I can track down actual text anywhere, but I know the digital Research gave strong warnings against depending on case-sensitive file names. For things like CP/NET, and possibly MP/M, it was not likely to work. MBASIC was a known "outlier", and of course one could write programs that passed lower-case names in FCBs. I suspect DRI would say "MBASIC shouldn't do that". At the very least "use at your own risk". It's not like someone can't totally hornswoggle their Windows or Linux platform today.

Fred Weigel

unread,
May 22, 2020, 12:34:41 PM5/22/20
to
Martin

You are correct. I ran my test case on a CP/NET network mapped drive running over high speed serial, against a CP/NET server running on a linux host that does case conversion -- and does not respect file attributes.

In that environment, it does not work.

FredW

Martin

unread,
May 22, 2020, 3:04:48 PM5/22/20
to
Am 05/22/2020 06:34 PM, Fred Weigel schrieb:
> On Wednesday, May 20, 2020 at 10:31:22 PM UTC-4, Martin wrote:
>> Am 05/21/2020 02:45 AM, Fred Weigel schrieb:
>>> Interesting thought. But we can easily test this:

[...]

>>> See? It doesn't actually work. "Fred" is to be the same as "fred"... even
>>> though they are distinct from "FRED".
>>>
>>> FredW
>>>
>>>
>>
>> Wrong!
>> Of course, it works!
>>
>>
>> What is your test environment?
>> Are you using an emulator without real disk images?
>> And where is "FRED" in your experiment?
>>
>>
>> I repeated your tests using mbasic 5.2 running on CP/M 2.2.
>> I have extended it a little bit, it also tests "FRED".

[...]

>
> Martin
>
> You are correct. I ran my test case on a CP/NET network mapped drive running over high speed serial, against a CP/NET server running on a linux host that does case conversion -- and does not respect file attributes.
>
> In that environment, it does not work.
>
> FredW
>

Thanks for the confirmation.
The strange upper/lower case dependency was a strong indicator...

Please understand my post only as a technical clarification.

It was not made to encourage the (ab)use of this sloppy inner working

Martin

techno...@gmail.com

unread,
Aug 7, 2020, 7:22:57 AM8/7/20
to
On Tuesday, August 1, 2017 at 2:12:40 PM UTC-4, PianoMatt wrote:
I just ran across this problem and your messages on how to resolve it. I had saved "pi.bas". It would only show in a DIR without arguments. Dir for it or any part of it would not show. I then saved "PI.BAS" alongside it without fault. Both files will load and run in MBASIC but I cannot address pi.bas from the CCP no matter what. Your advice to "KILL "pi.bas"" worked perfectly. I think the assessment that this is a glitch with Mbasic is right. If it is the application's responsibility to ensure capital letters for filenames, in the absence of CCP in memory, then this is a Microsoft bug. I think we should bring it to their attention and demand a fix, put Bill Gates back on the keyboard. LOL. IIRC Mbasic is one of his babies. (Oh, I found this bug on a ZRCC running CP/M 3.)

Best,

Jeff

Udo Munk

unread,
Aug 7, 2020, 8:33:39 AM8/7/20
to
You can create a FCB with lower case filenames in any language, this is not a
problem of mbasic only. If one wants to fix it, the BDOS functions with a FCB
as argument must be changed, so that they convert lower case in the FCB's
filename part to upper case.

So this is all DRI's fault, improper API to the BDOS ;-)

Douglas Miller

unread,
Aug 7, 2020, 9:31:24 AM8/7/20
to
On Friday, August 7, 2020 at 6:22:57 AM UTC-5, techno...@gmail.com wrote:
>...
> I think we should bring it to their attention and demand a fix, put Bill Gates back on the keyboard. LOL. IIRC Mbasic is one of his babies. (Oh, I found this bug on a ZRCC running CP/M 3.)
>
> Best,
>
> Jeff

I'm never one to miss a chance to point fingers at Bill, but I don't believe he actually did any programming back then. I seem to recall hearing, about 20 years ago, that Bill was going to "learn how to program". As was often the case (Apple too), it was a partnership of a computer wiz and some business guy (Bill@MS, Steve@Apple)

Tom Lake

unread,
Aug 8, 2020, 2:58:09 AM8/8/20
to
Bill Gates was a programming whiz even as a teenager. He developed a program that synchronized traffic lights and sold many copies to cities way before he and Paul Allen started Micro-Soft (as it was first known)

Douglas Miller

unread,
Aug 8, 2020, 8:01:42 AM8/8/20
to
On Saturday, August 8, 2020 at 1:58:09 AM UTC-5, Tom Lake wrote:
>...
>
> Bill Gates was a programming whiz even as a teenager. He developed a program that synchronized traffic lights and sold many copies to cities way before he and Paul Allen started Micro-Soft (as it was first known)

Interesting... (reading Bill Gate's wikipedia article) although I'm not sure his accomplishments there rise to the level of wiz(ard). Still, I was always impressed with MicroSoft computer language products. My opinions changed the more time I spent using their OSes and apps, especially Windows and Word. And dealing with the disappointments that were MS-DOS. The whole Digital Research thing and all the rumors flying around about that probably didn't help with my opinions. There did seem to be a marked change in product quality about the time of MS-DOS, or at least by Windows.

Tony Nicholson

unread,
Aug 9, 2020, 1:48:18 AM8/9/20
to
I've just uploaded the sourcecode for a CP/M PLUS RSX that I
wrote over 35 years ago to workaround the MicroSoft BASIC-80
"lowercase defect" with MBASIC (and OBASIC).

It works by intercepting BDOS calls for file and directory
manipulation and forces an uppercase filename (while keeping
any high-bit file attributes).

You'll find it at -

https://drive.google.com/file/d/1RAV-AUtd2XMe0hp-pSNBqvhNjcHeXGeJ/view?usp=sharing

Build it with M80 (or a compatible Zilog mnemonic assembler),
as per the comments and use the GENCOM utility to attach it
to MBASIC.COM

Tony

Douglas Miller

unread,
Aug 9, 2020, 9:30:38 AM8/9/20
to
On Sunday, August 9, 2020 at 12:48:18 AM UTC-5, Tony Nicholson wrote:
>
> I've just uploaded the sourcecode for a CP/M PLUS RSX that I
> wrote over 35 years ago to workaround the MicroSoft BASIC-80
> "lowercase defect" with MBASIC (and OBASIC).
>
>...
>
> Tony

Nice solution. Clean, elegant. Doesn't penalize non-offending programs.

Tony Nicholson

unread,
Aug 9, 2020, 7:08:37 PM8/9/20
to
Thanks.

Of course this had to happen too - I found an updated version
on another floppy disk image dated a couple of days later. In
this one I'd fixed the BDOS file rename case to update the FCB
new name field too.

I've overwritten the previous copy that was shared on Google
Drive with this one. Same link as before -

https://drive.google.com/file/d/1RAV-AUtd2XMe0hp-pSNBqvhNjcHeXGeJ/view?usp=sharing

Tony
Message has been deleted
0 new messages