Understanding file names and directories in FreeDOS

Learn how to create, edit, and name files in FreeDOS.
47 readers like this.
Files in a folder

The open source operating system FreeDOS is a tried-and-true project that helps users play retro games, update firmware, run outdated but beloved applications, and study operating system design. FreeDOS offers insights into the history of personal computing (because it implements the de facto operating system of the early '80s) but in a modern context. In this article, I'll use FreeDOS to explain how file names and extensions developed.

Understanding file names and ASCII text

FreeDOS file names follow what is called the 8.3 convention. This means that all FreeDOS file names have two parts that contain up to eight and three characters, respectively. The first part is often referred to as the file name (which can be a little confusing because the combination of the file name and the file extension is also called a file name). This part can have anywhere from one to eight characters in it. This is followed by the extension, which can have from zero to three characters. These two parts are separated by a dot.

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. That's because many of these other characters have been assigned a special use in FreeDOS. Some of the characters that can appear in a FreeDOS file name are:

~ ! @ # $ % ^ & ( ) _ - { } `

There are also characters in the extended ASCII set that can be used, such as �.

Characters with a special meaning in FreeDOS that, therefore, cannot be used in file names include:

*/ + | \ = ? [ ] ; : " . < > ,

Also, you cannot use a space in a FreeDOS file name. The FreeDOS console uses spaces to separate commands from options and parameters.

FreeDOS is case insensitive, so it doesn't matter whether you use uppercase or lowercase letters. All letters are converted to uppercase, so your files end up with uppercase letters in the name, no matter what you do.

File extensions

A file in FreeDOS isn't required to have an extension, but file extensions do have some uses. Certain file extensions have built-in meanings in FreeDOS, such as:

  • EXE: executable file
  • COM: command file
  • SYS: system file
  • BAT: batch file

Specific software programs use other extensions, or you can use them when you create a file. These extensions have no absolute file associations, so if you use a FreeDOS word processor, it doesn't matter what extension you use for your files. You could get creative and use extensions as part of your filing system if you want. For instance, you could name your memos using *.JAN, *.FEB, *.MAR, *.APR, and so on.

Editing files

FreeDOS comes with the Edit application for quick and easy text editing. It's a simple editor with a menu bar along the top of the screen for easy access to all the usual functions (such as copy, paste, save, and so on.)

As you might expect, many other text editors are available, including the tiny but versatile e3 editor. You can find a good variety of FreeDOS applications on GitLab.

Creating files

You can create empty files in FreeDOS using the touch command. This simple utility updates a file's modification time or creates a new file:

C:\>touch foo.txt
C:\>dir
FOO      TXT    0  01-12-2021 10:00a

You can also create a file directly from the FreeDOS console without using the Edit text editor. First, use the copy command to copy input in the console (con for short) into a new file object. Terminate input with Ctrl+Z followed by the Return or Enter key:

C:\>copy con test.txt
con => test.txt
This is a test file.
^Z

The Ctrl+Z character shows up in the console as ^Z. It isn't copied to the file but serves as an End of File (EOF) delimiter. In other words, it tells FreeDOS when to stop copying. This is a neat trick for making quick notes or starting a simple document to work on later.

Files and FreeDOS

FreeDOS is open source, free, and easy to install. Exploring how FreeDOS treats files can help you understand how computing has developed over the years, regardless of your usual operating system. Boot up FreeDOS and start exploring modern retro computing!


Some of the information in this article was previously published in DOS lesson 7: DOS filenames; ASCII (CC BY-SA 4.0).

What to read next
Tags
User profile image.
Former Project Manager at Ford Motor Credit Company, contributor to Hacker Public Radio, contributor to Full Circle Magazine, former Publicity Director for Ohio Linux Fest, former Tech Track manager for Penguicon, and now very happily retired.

Contributors

Comments are closed.

Creative Commons LicenseThis work is licensed under a Creative Commons Attribution-Share Alike 4.0 International License.