Why Does the DOS 'TYPE' Command Fail to Display My Text File?

  • Thread starter Thread starter jackson6612
  • Start date Start date
  • Tags Tags
    Dos Type
Click For Summary

Discussion Overview

The discussion revolves around the failure of the DOS "TYPE" command to display the contents of a text file, with participants exploring reasons for this issue, including syntax errors related to spaces in file paths and historical limitations of file naming conventions in DOS.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Historical

Main Points Raised

  • One participant reports an issue with the "TYPE" command failing to display a text file due to potential syntax errors.
  • Another participant suggests that spaces in the file path may break the syntax and recommends using quotes around the path and file name.
  • A participant expresses confusion about the necessity of quotes, stating they have not seen them used with DOS commands before.
  • After using quotes correctly, a participant acknowledges that the command now works but questions why spaces cause syntax issues.
  • Discussion includes historical context about early DOS limitations, such as the restriction of file names to a maximum of six or eight characters plus an extension.
  • Participants discuss the implications of these limitations, including the efficiency of storage and ease of file system implementation.
  • One participant shares personal experiences with early computer technology, including the cost and capacity of hard disks compared to floppy disks.
  • Another participant notes that the 8.3 filename format is still used on FAT partitions by Windows, explaining how long file names are managed in the file system.
  • There is a reflection on the rapid pace of technological advancement compared to earlier times, with a participant expressing gratitude for being born in a more modern era.

Areas of Agreement / Disagreement

Participants express varying levels of understanding regarding the syntax issues with the "TYPE" command and the historical context of file naming conventions. There is no consensus on the necessity of quotes or the implications of early DOS limitations.

Contextual Notes

Participants reference the ambiguity introduced by spaces in file names and the evolution of file naming conventions over time, but do not resolve the underlying technical issues or historical reasons for these changes.

jackson6612
Messages
334
Reaction score
1
dos "TYPE" command problem

Hi

You can see in the video that I have text file "hello" in "C:\Documents and Settings\Administrator". But when I try to access it using the "TYPE" command it fails. Could you please explain the reason for this failure?

The "type" command displays the contents of a text file or files. Syntax: TYPE [drive:][path]filename

Video:

Thanks.
 
Last edited by a moderator:
Technology news on Phys.org


Spaces in the path break the syntax. Try to use quotes around path and file name.
 


Hi Borek

I think I have used the command as told in the help file. I have never seen quotes being used with DOS commands. I still don't understand what's wrong with it. Perhaps, the "TYPE" isn't used to show the contents of a text file!
 


You were right. I have used qoutes as:
C:"\Documents and Settings\Administrator\hello.txt"

It works now. I still don't understand how the spaces break the syntax because they are natural part of the path; how else would you write "Documents and Settings"?

Thanks a lot.
 


Command may take many arguments, they are separated by spaces. There is no way to tell if spaces separate arguments, or are part of the string. That's a problem that was not present in early DOS times, when spaces were not allowed in file names, once they were allowed it added ambiguity.
 


Borek said:
in early DOS times, when spaces were not allowed in file names

Also file names could be no longer than either six or eight characters, plus three for the extension. So a name like "hello.txt" was OK, but not "hellothere.txt" or "my file.txt". As far as I know, most operating systems had this kind of restriction until the mid 1980s. I first used long file names with a Macintosh in 1985.
 


jtbell said:
Also file names could be no longer than either six or eight characters, plus three for the extension. So a name like "hello.txt" was OK, but not "hellothere.txt" or "my file.txt". As far as I know, most operating systems had this kind of restriction until the mid 1980s. I first used long file names with a Macintosh in 1985.

Hi JT

I have searched it. It's called 8.3 filename, e.g. TEXTFILE.TXT. It was used by older versions of DOS. I wonder what was the reason for this limitation. Could you please help me with it? Thanks.
 


jackson6612 said:
I have searched it. It's called 8.3 filename, e.g. TEXTFILE.TXT. It was used by older versions of DOS. I wonder what was the reason for this limitation.

When you had something like 100/200 kB on disk, using long names is a waste of space. It is also much easier to implement file system with a rigid format of file names.
 


Borek said:
something like 100/200 kB on disk

These were floppy disks, of course. Hard disks were a luxury on personal computers in those days. My first hard disk, an external unit for a Macintosh, had a capacity of 20 megabytes (yes, MEGAbytes) and cost about $700 in 1988 (probably equivalent to at least $1500 now).
 
  • #10


Luxury gradation these days: one sided floppy, two sided floppy, two two sided floppy drives in one computer, hard disk. I have skipped one sided part (although I think I do remember one sided floppy disks being sold). We were a little bit late with computers in this part of the world, I think we catch up around 386/486.

Around 1990 I wrote in Pascal program that was able to read/write/import/export files from some version of CP/M and TOS (T=Timex, not tape), we (editorial staff of Bajtek and Top Secret magazines) used it to transfer files between Spectrum with FDD3000 and PC. Program was called Borek Utilities :smile:
 
  • #11


Thank you, Borek, JT. You both have really helped me. Borek, thanks a lot for always being there to help me. I wish you good health and happiness.

jtbell said:
These were floppy disks, of course. Hard disks were a luxury on personal computers in those days. My first hard disk, an external unit for a Macintosh, had a capacity of 20 megabytes (yes, MEGAbytes) and cost about $700 in 1988 (probably equivalent to at least $1500 now).

After reading yours and Borek's posts I believe you guys really lived in a technologically expensive times. Thank God that I was born in modern times after '88.:smile:
 
  • #12


jackson6612 said:
8.3 filename, e.g. TEXTFILE.TXT. It was used by older versions of DOS.
Still used on FAT partitions by windows. The file name entry is 8.3, and is the "short name" of the file. If actual file name is greater than 8.3, then following the 8.3 name entry, a set of fixed size (16 byte) entries (with "hidden" and "volume" attributes set) are used used to contain the "long name" as a zero terminated string.

http://en.wikipedia.org/wiki/Long_filename
 
  • #13


jackson6612 said:
After reading yours and Borek's posts I believe you guys really lived in a technologically expensive times.

Well, it wasn't that it was expensive, it's that it was right on the bleeding edge.

I'm not sure what the current equivalent bleeding edge technology would be today. It doesn't even really apply, since current advancements happen on the order of months/weeks instead of years. Even 4G or the latest iPad is just another incremental change - old news.
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
11K
  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
2
Views
2K
  • · Replies 19 ·
Replies
19
Views
6K
Replies
10
Views
5K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 75 ·
3
Replies
75
Views
7K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K