End-of-file

In computing, end-of-file (EOF)[1] is a condition in a computer operating system where no more data can be read from a data source. The data source is usually called a file or stream.

Details

In the C standard library, the character-reading functions such as getchar return a value equal to the symbolic value (macro) EOF to indicate that an end-of-file condition has occurred. The actual value of EOF is implementation-dependent and must be negative (but is commonly −1, such as in glibc[2]). Block-reading functions return the number of bytes read, and if this is fewer than asked for, then the end of file was reached or an error occurred (checking of errno or dedicated function, such as ferror is required to determine which).

EOF character

Input from a terminal never really "ends" (unless the device is disconnected), but it is useful to enter more than one "file" into a terminal, so a key sequence is reserved to indicate end of input. In UNIX, the translation of the keystroke to EOF is performed by the terminal driver, so a program does not need to distinguish terminals from other input files. By default, the driver converts a Control-D character at the start of a line into an end-of-file indicator. To insert an actual Control-D (ASCII 04) character into the input stream, the user precedes it with a "quote" command character (usually Control-V). AmigaDOS is similar but uses Control-\ instead of Control-D.

In DOS and Windows (and in CP/M and many DEC operating systems such as the PDP-6 monitor,[3] RT-11, VMS or TOPS-10[4]), reading from the terminal will never produce an EOF. Instead, programs recognize that the source is a terminal (or other "character device") and interpret a given reserved character or sequence as an end-of-file indicator; most commonly, this is an ASCII Control-Z, code 26. Some MS-DOS programs, including parts of the Microsoft MS-DOS shell (COMMAND.COM) and operating-system utility programs (such as EDLIN), treat a Control-Z in a text file as marking the end of meaningful data, and/or append a Control-Z to the end when writing a text file. This was done for two reasons:

  • Backward compatibility with CP/M. The CP/M file system (and also the original 8-bit FAT implemented in Microsoft BASIC) only recorded the lengths of files in multiples of 128-byte "records", so, by convention, a Control-Z character was used to mark the end of meaningful data if it ended in the middle of a record. The FAT12 filesystem introduced with 86-DOS and MS-DOS has always recorded the exact byte-length of files, so this was never necessary on DOS.
  • It allows programs to use the same code to read input from both a terminal and a text file.

In the ANSI X3.27-1969 magnetic tape standard, the end of file was indicated by a tape mark, which consisted of a gap of approximately 3.5 inches of tape followed by a single byte containing the character 0x13 (hex) for nine-track tapes and 017 (octal) for seven-track tapes.[5] The end-of-tape, commonly abbreviated as EOT, was indicated by two tape marks. This was the standard used, for example, on IBM 360. The reflective strip that was used to announce impending physical end of tape was also called an EOT marker.

See also

References

  1. ^ Pollock, Wayne. "Shell Here Document Overview". hccfl.edu. Archived from the original on 2014-05-29. Retrieved 2014-05-28.
  2. ^ "The GNU C Library". www.gnu.org.
  3. ^ "Table of IO Device Characteristics - Console or Teletypewriters". PDP-6 Multiprogramming System Manual (PDF). Maynard, Massachusetts, USA: Digital Equipment Corporation (DEC). 1965. p. 43. DEC-6-0-EX-SYS-UM-IP-PRE00. Archived (PDF) from the original on 2014-07-14. Retrieved 2014-07-10. (1+84+10 pages)
  4. ^ "5.1.1.1. Device Dependent Functions - Data Modes - Full-Duplex Software A(ASCII) and AL(ASCII Line)". PDP-10 Reference Handbook: Communicating with the Monitor - Time-Sharing Monitors (PDF). Vol. 3. Digital Equipment Corporation (DEC). 1969. pp. 5-3 – 5-6 [5-5 (431)]. Archived (PDF) from the original on 2011-11-15. Retrieved 2014-07-10. (207 pages)
  5. ^ "Tape Transfer (Pre-1977): Exchange Media: MARC 21 Specifications for Record Structure, Character Sets, and Exchange Media (Library of Congress)". www.loc.gov.

Read other articles:

Cenarchaeum Klasifikasi ilmiah Domain: Archaea Kerajaan: Crenarchaeota Filum: Thaumarchaeota Kelas: incertae sedis Ordo: Cenarchaeales Famili: Cenarchaeaceae Genus: Cenarchaeum Spesies C. symbiosum uncultured Cenarchaeum sp. Sinonim Cenarchaeum DeLong and Preston 1996 Dalam taksonomi, Cenarchaeum adalah genus dari Cenarchaeaceae.[1] Arkea laut Cenarchaeum symbiosum hidup di dalam (itu adalah endosimbion dari) spons Axinella mexicana.[2] Referensi ^ See the NCBI webpage on Cen...

 

Steyr AUG, salah satu senapan bullpup yang paling sukses. Bullpup adalah konfigurasi senjata api, di mana mekanisme dan magazennya terletak di belakang pelatuk. Konfigurasi seperti ini meningkatkan perbandingan panjang laras terhadap panjang total senapan, yang memungkinkan membuat senapan yang larasnya sama dengan laras senapan biasa, tetapi total panjang senapan lebih pendek. Keuntungannya selain lebih pendek, juga relatif lebih ringan. Konsep konfigurasi seperti ini sudah muncul sejak sebe...

 

Kawasan perkotaan Pully. Pully adalah sebuah kotamadya di Distrik Lausanne, Kanton Vaud, Swiss. Pully merupakan salah satu pinggiran timur Lausanne, terletak di pesisir Lac Léman (Danau Jenewa) dan di kaki ladang anggur Lavaux di jalanan antara Vevê dan Montreux. Kota kembar Oberehnheim, Prancis Artikel bertopik geografi atau tempat Swiss ini adalah sebuah rintisan. Anda dapat membantu Wikipedia dengan mengembangkannya.lbs

العلاقات الجزائرية الكندية   الجزائر   كندا السفارات كندا   العنوان : الجزائر العاصمة الجزائر   العنوان : أوتاوا تعديل مصدري - تعديل   تشير العلاقات بين الجزائر وكندا إلى العلاقات بين جمهورية الجزائرية الديمقراطية الشعبية وكندا. ولدى كندا سفارة ...

 

ناورو بوابة ويكيبيديا حول إحدى أوقيانوسيا جمهورية ناورو (بالإنجليزية: Republic of Nauru)‏ أو ما كانت تعرف قديما باسم الجزيرة السعيدة أو الجزيرة المبهجة هي دولة جزرية تقع في مايكرونيزيا في المحيط الهادي. أقرب الجزر لها هي جزيرة بانابا في جمهورية كيريباس، التي تبعد عنها 300 كم شرقاً....

 

Couvent d'Ebernach Vue du couvent Présentation Nom local Kloster Ebernach Culte Catholicisme Rattachement Ordre des frères mineurs Début de la construction XIIe siècle Fin des travaux Reconstruit en 1673 Géographie Pays Allemagne Land Rhénanie-Palatinat Ville Cochem Coordonnées 50° 08′ 20″ nord, 7° 11′ 15″ est Géolocalisation sur la carte : Rhénanie-Palatinat Géolocalisation sur la carte : Allemagne modifier  Le couvent d'...

Mix 106.5Wilayah siarSydneyMerekMix 106.5SloganSydney's #1 Hit Music StationFrekuensi106.5 MHz FMMulai mengudaraApril 1994FormatMainstream CHR (pop, rock, Hip/Hop)Pancaran daya efektif150,000 wattKetinggian di atas medan224 m[1]Koordinat transmisi33°48′20″S 151°10′51″E / 33.80556°S 151.18083°E / -33.80556; 151.18083Kode panggil sebelumnya2UW (hingga April 1994)PemilikAustralian Radio Network Mix 106.5 (kode panggil resmi: 2WFM) adalah sebuah stasiun...

 

American baseball player (1908-1984) Baseball player Ival GoodmanRight fielderBorn: (1908-07-23)July 23, 1908Northview, Missouri, U.S.Died: November 25, 1984(1984-11-25) (aged 76)Cincinnati, Ohio, U.S.Batted: LeftThrew: RightMLB debutApril 16, 1935, for the Cincinnati RedsLast MLB appearanceAugust 23, 1944, for the Chicago CubsMLB statisticsBatting average.281Home runs95Runs batted in525 Teams Cincinnati Reds (1935–1942) Chicago Cubs (1943–1944) Career h...

 

Artikel ini perlu diwikifikasi agar memenuhi standar kualitas Wikipedia. Anda dapat memberikan bantuan berupa penambahan pranala dalam, atau dengan merapikan tata letak dari artikel ini. Untuk keterangan lebih lanjut, klik [tampil] di bagian kanan. Mengganti markah HTML dengan markah wiki bila dimungkinkan. Tambahkan pranala wiki. Bila dirasa perlu, buatlah pautan ke artikel wiki lainnya dengan cara menambahkan [[ dan ]] pada kata yang bersangkutan (lihat WP:LINK untuk keterangan lebih lanjut...

Members of the New South Wales Legislative Assembly who served in the 30th parliament held their seats from 1932 to 1935. They were elected at the 1932 state election,[1] and at by-elections.[2][3][4] The Speaker was Sir Daniel Levy.[5] Name Party Electorate Term in office George Ardill   United Australia Yass 1930–1941 Jack Baddeley   Labor Cessnock 1922–1949 Richard Ball   Country Corowa 1895–1898, 1904–1937 Henry Bate   U...

 

Ini adalah artikel tentang Korea secara umum. Untuk negara Korea modern, lihat Korea Utara dan Korea Selatan. Korea조선 (bahasa Korea Utara)(Joseon)한국 (bahasa Korea Selatan)(Hanguk) Bendera Korea sebelum pemisahan (kiri)Bendera upaya penyatuan (kanan)Lagu kebangsaan: Aegukka (Korea Utara)Aegukga (Korea Selatan)Arirang (lagu penyatuan)Ibu kotaPyongyang (Korea Utara)Seoul (Korea Selatan)Kota terbesarSeoulBahasa resmiKoreaAksara resmiJosŏn-gŭl/HangeulPendirian• Gojoseon 2333 ...

 

Pamela ChopraPamela Chopra dengan suaminya, Yash Chopra (kanan) pada tahun 2011LahirPamela Singh(1948-07-29)29 Juli 1948Meninggal20 April 2023(2023-04-20) (umur 75)Mumbai, Maharashtra, IndiaKebangsaanIndiaNama lainPam ChopraPekerjaanPenyanyi playback, produser film, penulisSuami/istriYash Chopra ​(m. 1970)​AnakAditya ChopraUday Chopra Pamela Chopra (née Singh; 29 Juli 1948 – 20 April 2023)[1] adalah penyanyi playback Bollywood. ...

Mappa dei principali aeroporti italiani Gli aeroporti in Italia sono variamente distribuiti nelle varie regioni italiane, e a ciascuno di essi è assegnato un codice aeroportuale ICAO. Il nome, nel caso di aeroporti aperti al traffico civile, è quello della documentazione ufficiale prodotta dall'Ente nazionale per l'aviazione civile (ENAC).[1] Gli aeroporti sono raggruppati distinguendo tra quelli certificati dall'ENAC, presenti nelle liste ENAC e non presenti nelle liste ENAC. Il nu...

 

Estuary and harbor of Massachusetts Bay This article is about Boston Harbor, Massachusetts. For other uses, see Boston Harbor (disambiguation). Topographic map of Boston Harbor USCGC James pulls into Harbor in August 2015. Boston Harbor is a natural harbor and estuary of Massachusetts Bay, and is located adjacent to the city of Boston, Massachusetts. It is home to the Port of Boston, a major shipping facility in the Northeastern United States.[1] History The Brig Antelope in Boston Ha...

 

Egyptian chemist Mostafa El-SayedEl-Sayed in March 2016BornEgyptNationalityEgyptianAlma materAin Shams University Florida State UniversityKnown forNanotechnologySpectroscopyEl-Sayed ruleAwardsKing Faisal International Prize 1990Irving Langmuir Award 2002National Medal of Science 2007 Glenn T. Seaborg Medal 2009 Priestley Medal 2016Scientific careerFieldsChemical physicistInstitutionsGeorgia Institute of TechnologyHarvard UniversityUniversity of California at Los AngelesDoctoral advi...

Somua MCLUn Somua MCL 5 dépannage secondo tipoDescrizioneTipotrattore d'artiglieria/veicolo da recupero carri Equipaggio3 CostruttoreSOMUA Data impostazionesettembre 1934 Data primo collaudo1936 Data entrata in servizio1937 Data ritiro dal servizio1945 Utilizzatore principaleArmée de terre Altri utilizzatoriWehrmacht Esemplaritracteur: 15[1]dépannage: 78[2] Sviluppato dalSomua MCG Altre variantiMCL 5 tracteurMCL 5 dépannageMCL 11 Somua-Coder Dimensioni e pesoLunghezza...

 

Freedom of religion Concepts Laicism Religious discrimination Religious censorship Religious liberty Religious pluralism Secularism Separation of church and state Anti-clericalism School prayer Catholic priests in public office Confessionalism Theocracy State religion Secular state Confessional state Atheist state Status by country Africa Algeria Angola Benin Botswana Burkina Faso Burundi Cameroon Cape Verde Central African Republic Chad Comoros DR Congo Egypt Mauritania Morocco South Africa...

 

هذه هي قائمة المشاريع العملاقة، أي المشاريع الاستثمارية للغاية وذات النطاق الواسع. وتسمى أيضاً في بعض الأحيان «برامج كُبرى». بعض هذه المشاريع من الضخامة بحيث لا يجوز أبداً أن تكون القائمة كاملة. أصبح المشروع الأكثر تكلفة في تاريخ العالم من حيث تكلفة التضخم النقدي المعدل ه�...

American collegiate athletics conference Big Ten redirects here. For other uses, see Big Ten (disambiguation). Big Ten ConferenceFormerlyIntercollegiate Conference of Faculty Representatives(officially, 1896–1987)Western Conference(1896–1899)Big Nine(1899–1917, 1946–1950)AssociationNCAAFounded1896; 128 years ago (1896)CommissionerTony PetittiSports fielded 28 men's: 14 women's: 14 DivisionDivision ISubdivisionFBSNo. of teams14 (18 in 2024)HeadquartersRosemont, Illino...

 

  لمعانٍ أخرى، طالع أشتون (توضيح). أشتون   الإحداثيات 43°18′43″N 95°47′30″W / 43.311944444444°N 95.791666666667°W / 43.311944444444; -95.791666666667   [1] تقسيم إداري  البلد الولايات المتحدة[2]  التقسيم الأعلى مقاطعة أوسيولا  خصائص جغرافية  المساحة 2.583637 كيلومتر مربع2.625774...