Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 279681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:03:11+00:00 2026-05-12T05:03:11+00:00

When I’m generating a text file programatically, should I insert the ASCII EOF marker

  • 0

When I’m generating a text file programatically, should I insert the ASCII EOF marker (decimal value 26) at the end of the file?

Do the .NET Programming Languages do this automatically?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:03:12+00:00Added an answer on May 12, 2026 at 5:03 am

    There’s no reason for the ^Z EOF marker anymore (and there hasn’t been for a long time) – it’s a hold over from CP/M which did not support exact lengths for file sizes in the directory – file sizes were in terms of the number of 128 byte blocks, so to end a file on a non-128 byte boundary you had to use an EOF character.

    Since early versions of MS-DOS were heavily influenced by CP/M (and Microsoft wanted CP/M programs to port easily), the convention stuck.

    Your program should open text files with the appropriate attributes so the OS and/or language runtime will signal an EOF when it sees a ^Z in case you come across a file that uses the convention. But there’s no need to write one anymore.

    One possible exception is if you have a binary file, but want to put some text at the start of it, then a ^Z, then your data. If someone dumps it to the console it’ll say something intelligent instead of spewing garbage. There’s not a whole lot of reason to do this, but I’ve seen that done rarely.

    From Wikipedia (http://en.wikipedia.org/wiki/CP/M):

    File size was specified as the number
    of 128-byte records (directly
    corresponding to disk sectors on
    8-inch drives) occupied by a file on
    the disk. There was no generally
    supported way of specifying byte-exact
    file sizes. The current size of a file
    was maintained in the file’s file
    control block (FCB) by the operating
    system. Since many application
    programs (such as text editors) prefer
    to deal with files as sequences of
    characters rather than as sequences of
    records, by convention text files were
    terminated with a control-Z character
    (ASCII SUB, hexadecimal 1A).
    Determining the end of a text file
    therefore involved examining the last
    record of the file to locate the
    terminating control-Z. This also meant
    that inserting a control-Z character
    into the middle of a file usually had
    the effect of truncating the text
    contents of the file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 205k
  • Answers 205k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I agree with Adam, the use case sounds like JMS… May 12, 2026 at 9:03 pm
  • Editorial Team
    Editorial Team added an answer To show how easy it is to let two applications… May 12, 2026 at 9:03 pm
  • Editorial Team
    Editorial Team added an answer controllerInstance.ModelState.AddModelError("", "Dummy value."); Adding a dummy value before the method… May 12, 2026 at 9:03 pm

Related Questions

In order to apply a triggered animation to all ToolTip s in my app,
this is what i have right now Drawing an RSS feed into the php,
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
I have a JSP page retrieving data and when single or double quotes are
I have a French site that I want to parse, but am running into

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.