132 lines
11 KiB
Plaintext
132 lines
11 KiB
Plaintext
|
|
Episode: 3530
|
||
|
|
Title: HPR3530: Filenames and ASCII
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr3530/hpr3530.mp3
|
||
|
|
Transcribed: 2025-10-25 01:01:49
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
This is Hacker Public Radio Episode 3,534 Friday, 11th of February 2022.
|
||
|
|
Tid's show is entitled, Phila Names and Eski and is part of the series DOS it is hosted by OUKA
|
||
|
|
and is about 15 minutes long and carries a clean flag.
|
||
|
|
The summary is, we continue our look at the Old Warhorse, DOS this time it is DOS Phila Names and Eski.
|
||
|
|
This episode of HPR is brought to you by archive.org.
|
||
|
|
Support universal access to all knowledge by heading over to archive.org forward slash donate.
|
||
|
|
Hello, this is OUKA, welcome you to Hacker Public Radio and another exciting episode in our DOS series.
|
||
|
|
And what I'm going to take a look at today, there's a couple of topics.
|
||
|
|
One of them is DOS Phila Names and then related to that is the topic of ASCII characters.
|
||
|
|
So let's go. DOS Phila Names follow what is called an 8.3 or 8.3 convention.
|
||
|
|
Now this means that all DOS Phila Names have two parts with up to 8.3 characters respectively.
|
||
|
|
Now the up to part is important, you can have less.
|
||
|
|
But the first part is often referred to as the file name in some documentation that I've seen.
|
||
|
|
That can be a little confusing, but what are you going to do?
|
||
|
|
I can have anything from one to eight characters in it.
|
||
|
|
This is followed by the extension, which can have anything from zero to three characters.
|
||
|
|
Separating these two parts is a period, but in computer language we never call it a period,
|
||
|
|
we call it a dot. So 8.3. Now, file names can use any letter of the alphabet or any numeral.
|
||
|
|
Many of the other characters found on a keyboard are also allowed, but not all of them.
|
||
|
|
And that is because many of these other characters have been assigned a special use in DOS.
|
||
|
|
Now we call those reserved characters. So what are some of the characters that can appear in a
|
||
|
|
DOS file name other than letters and numbers? Well, there's the tilde, the exclamation mark,
|
||
|
|
the at sign, the pound sign, the dollar sign, the percent sign, the carrot, the ampersand,
|
||
|
|
left or right parentheses, underscore, dash, left and right curly brackets,
|
||
|
|
and apostrophe. Now, there are additional characters in the extended asky set that can be used.
|
||
|
|
And so you might sometimes see an odd file name if someone managed to use those.
|
||
|
|
Now there are characters that have a special meaning in DOS, the reserved ones, and they cannot be used.
|
||
|
|
These would include the asterisk, the forward slash, the plus sign, the vertical bar,
|
||
|
|
the back slash, the equal sign, the question mark, left and right square brackets,
|
||
|
|
semicolon, colon, quotation mark, period, less than sign, greater than sign, and comma.
|
||
|
|
Also you cannot use a space in a DOS file name. Now you can actually simulate one using an
|
||
|
|
appropriate asky character, which we'll mention. Now the reason that you can't use a space is that
|
||
|
|
DOS uses spaces to separate items in the command line. We talked about this a lot in the previous
|
||
|
|
tutorial, so I hope you were paying attention to that. So you cannot use spaces, but you can
|
||
|
|
actually simulate a space. Now another thing, it does not matter whether you use upper or lower
|
||
|
|
case letters. DOS converts all letters to upper case in any event. So your files will all wind up with
|
||
|
|
upper case letters in the name no matter what you do. Now file extensions. In DOS, a file does not
|
||
|
|
need to have an extension. Now you can test this quite easily by creating a file called FU
|
||
|
|
and saving it in your DOS test directory. Do a directory listing using the DIR command
|
||
|
|
and you'll see it listed. But the file extension does have its uses in DOS. Certain file extensions
|
||
|
|
have built-in meanings such as EXE always denotes an executable file. COM is a command file.
|
||
|
|
SIS is a system file and BAT is a batch file. Now other extensions might be created by a
|
||
|
|
particular software program or by you when you create a file. One thing that is very different
|
||
|
|
in DOS when compared to Windows is that DOS does not have the associations that Windows has.
|
||
|
|
In Windows for instance, a .doc file will typically be associated with Microsoft Word.
|
||
|
|
And if you attempt to open this file, it will automatically call Word, open it and load the file.
|
||
|
|
DOS does not have any of this. Now there were some DOS shell programs like Norton desktop that
|
||
|
|
gave you some of these capabilities. And if you want to look at it that way, the ultimate DOS
|
||
|
|
shell program was Windows. At least up to the 3.11 level, I've even seen arguments that Windows 95
|
||
|
|
was nothing more than a DOS shell. We had some interesting arguments about that back in the days
|
||
|
|
and there was actually stuff in the help system. References that you dug into Windows 95 and saw
|
||
|
|
a reference to a version of DOS that it was. Now in any case, DOS does not have file associations.
|
||
|
|
So if you used a DOS Word processor, that didn't particularly matter what extension you used for
|
||
|
|
your files. You could get creative and use extensions as part of your filing system if you wanted.
|
||
|
|
You could, for instance, name your memos using .jan.feb.marr, etc. to help keep track of them.
|
||
|
|
I wouldn't do it exactly that way, but it is doable. However, if you're using a DOS window
|
||
|
|
on a Windows machine, you need to keep the needs of Windows in mind to be more careful with your
|
||
|
|
file extensions. In fact, although people often refer to it as a DOS window, it isn't. It isn't DOS.
|
||
|
|
It's calling a program called cmd.exe and it has a lot of similarities to DOS, but it's not
|
||
|
|
identical to DOS. Now, ASCII. We mentioned that the characters all come from the ASCII file set.
|
||
|
|
So what is ASCII? ASCII is an acronym for American Standard Code for Intermission Interchange.
|
||
|
|
So it is a seven-bit coding system for creating the letters, numbers, and punctuation characters
|
||
|
|
needed to create basic text files. A simple calculation shows that seven bits allows 128
|
||
|
|
possible characters. Two to the seventh power is 128. The same seven bits can be thought of as a
|
||
|
|
number, however, which means that we can't think of letters and punctuation marks as being numbers
|
||
|
|
in this particular coding scheme. Now, bearing in mind that computer numbering schemes always begin
|
||
|
|
with zero, the possible numbers range from zero to 127. Now to see how this works, boot into DOS.
|
||
|
|
Make sure the num lock is set on, hold down the alt key, and type a number from zero to 127
|
||
|
|
using the number pad. After typing the number, release the alt key and look at the result.
|
||
|
|
You should see a character of some kind appear. You must use the number pad for this exercise,
|
||
|
|
not the numbers at the top of the keyboard, by the way. Also, this works just as well in Windows as
|
||
|
|
in DOS. I have done that when I was putting this web page together to generate characters not
|
||
|
|
normally available in an HTML editor. Now, you may note that the name of this includes the word
|
||
|
|
American. What about people in other countries who want to use characters not usually found in
|
||
|
|
American words? Well, the answer was to add one more bit, creating an 8-bit system called extended
|
||
|
|
ASCII, and I've got a link to a chart that has twice as many possible characters running from zero to
|
||
|
|
255. The first half is the same as ASCII, but in the second half, additional characters like the Greek,
|
||
|
|
some of the Greek letters, the German double S letter, accented A, so this made the extended ASCII
|
||
|
|
quote more universal. It still has limitations, and that's why now in 2021, as I'm recording this,
|
||
|
|
as compared to the late 90s when I wrote it, the Unicode, which is much more comprehensive,
|
||
|
|
has become the standard. Now, I mentioned that you could simulate a space in a file name,
|
||
|
|
and it's very simple. In the file name, add the character Alt plus 255. This will look exactly
|
||
|
|
like a space, but to the computer it is something completely different. Note that if you want to use any
|
||
|
|
DOS commands involving this file, you will have to use the character Alt plus 255 in the appropriate
|
||
|
|
place, where the file will not be recognized, and you will get a file not found error.
|
||
|
|
You could use this in a DOS environment, I suppose, as a kind of primitive security.
|
||
|
|
No one could delete this file unless they knew to add the appropriate Alt plus 255.
|
||
|
|
Well, we all know, in this day and age, security through obscurity is not a good idea, but there it is.
|
||
|
|
Now, if you want to test this out, or any of the things that we do in these tutorials,
|
||
|
|
I suggest creating a directory on your hard drive, like C colon backslash DOS temp,
|
||
|
|
or C colon backslash DOS test, to play around in without messing up anything else on your computer.
|
||
|
|
You can then create files and sub-directories in here to test out all of these procedures.
|
||
|
|
Since creating files to test things is something you do a lot of, here's a genuinely geeky trick
|
||
|
|
to amaze your friends with. You can create a file directly from DOS without using any other program,
|
||
|
|
even DOS edit. Here is how. Let's say you're in your DOS temp directory, so your command prompt
|
||
|
|
to C colon backslash DOS temp, and then the greater than sign. So you would enter copy, space, con, space,
|
||
|
|
foo dot bar, and then you would type, this is a test file. Finally, hold down the control key and type
|
||
|
|
a Z. Now, if you do exactly that, you should get back a response from the computer that says one file,
|
||
|
|
parentheses S, close parentheses, copied. So here's what's going on. First, you're copying a file,
|
||
|
|
we've talked about the copy command, it does what it says on the tin. Copy a file from one place and
|
||
|
|
puts it in another place. Now, where is the file being copied from? It's being copied from con,
|
||
|
|
c-o-n, which is the DOS shorthand for console. The console in this case is your screen.
|
||
|
|
The file is going to be copied to foo dot bar, which will be created in the DOS temp directory.
|
||
|
|
Now, once you enter this command, the computer is just waiting for you to type in the contents of this
|
||
|
|
file. You will notice that after you hit the enter key, you do not get another command prompt.
|
||
|
|
It's waiting for you to start typing text. So I said type something like this is a test file.
|
||
|
|
Again, you hit the enter key, but still no command prompt. The computer things you may still
|
||
|
|
want to enter stuff. To tell the computer you are done, you need to enter an end-of-file marker,
|
||
|
|
e-o-f, and you do that by holding down the control key, and while it is down hitting z key,
|
||
|
|
the result should look like carrot z on your screen. Now, carrot is, it's like a little tent,
|
||
|
|
sort of like the greater than sign, but it's pointing up instead of to the right.
|
||
|
|
If you hit the enter key this time, the computer will copy the line, this is a test file,
|
||
|
|
into a file called foo dot bar, and give you the response, one file copied. Pretty neat, eh?
|
||
|
|
So, this is a hookah for hacker public radio, signing off, and is always encouraging you to support
|
||
|
|
free software. Bye-bye.
|
||
|
|
You've been listening to Hacker Public Radio at Hacker Public Radio dot org.
|
||
|
|
We are a community podcast network that releases shows every weekday Monday through Friday.
|
||
|
|
Today's show, like all our shows, was contributed by an HBR listener like yourself.
|
||
|
|
If you ever thought of recording a podcast, and click on our contributing,
|
||
|
|
to find out how easy it really is. Hacker Public Radio was founded by the digital
|
||
|
|
dot pound and the infonomicon computer club, and is part of the binary revolution at binrev.com.
|
||
|
|
If you have comments on today's show, please email the host directly, leave a comment on the website
|
||
|
|
or record a follow-up episode yourself. Unless otherwise status, today's show is released on the
|
||
|
|
Creative Commons, Attribution, ShareLive, 3.0 license.
|