Questions tagged [eof]

End of file (commonly abbreviated EOF) is a condition in a computer operating system where no more data can be read from a data source.

From Wikipedia:

End of file (commonly abbreviated EOF) 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.

EOF is also a macro defined in the <stdio.h> header of the C standard library. This macro:

expands to an integer constant expression, with type int and a negative value, that is returned by several functions to indicate end-of-file, that is, no more input from a stream;

For more information:

1831 questions
0
votes
2 answers

C code to read a text file does not find EOF (end of file)

I've wrote this short code to read a text file and copy its information to a new txt file, but doing some character substitution in the process. My problem is, the code does all the job it is supposed to do but it doesnt end. It cant find the EOF…
Kaiser
  • 35
  • 1
  • 3
  • 9
0
votes
0 answers

C++ filestream reading issues

So I am using a filestream to read and write 3 vectors of structs to 3 binary files however when I perform read and write operations it reads duplicates of each one which I dont understand. I think it is just a trivial error with my code. #include…
0
votes
1 answer

Sikuli, [error] SyntaxError ( "mismatched input '' expecting EOF", ) in IDE

I have error message and i have no idea why, i don't understand it. Would you help me with that? click("1421761210416.png") type("word" + Key.ENTER) click("1421761958712.png") if not exists("1421763759437.png"): …
0
votes
2 answers

C File Handling and end of the line character in Notepad

I was reading C File Handling and I ran into fseek() function. The following statement was written in the book, regarding the use of it: int fseek(FILE *stream, long offset, int from ); //The function prototype "On binary streams, seeks from…
Manish Kumar Sharma
  • 12,982
  • 9
  • 58
  • 105
0
votes
2 answers

Scan file contents into an array of a structure

I have a structure in my program that contains a particular array. I want to scan a random file with numbers and put the contents into that array. This is my code : ( NOTE : This is a sample from a bigger program, so I need the structure and arrays…
NLed
  • 1,845
  • 14
  • 39
  • 68
0
votes
1 answer

Why is this Assembly Code not reading the same bytes over again but instead returns and End Of File?

This is the code I have: section .bss bufflen equ 1024 buff: resb bufflen whatread: resb 8 section .data section .text global main main: nop read: mov eax,3 ; Specify sys_read mov ebx,0 ;…
Koray Tugay
  • 22,894
  • 45
  • 188
  • 319
0
votes
1 answer

multiple task in one bash script

I am trying to execute three tasks in one bash script. The coding I did is : #!/bin/bash (cd TRAJ_OctylGlcTryp_C1/ && cpptraj zOctylgluTryC1.prmtop << EOF trajin reImaged-OctylgluTryC1.nc 1 70000 500 trajout reImaged-OctylgluTryC1-500.nc netcdf EOF…
Vijay
  • 965
  • 5
  • 13
  • 27
0
votes
2 answers

While loop with hasNext(); not fully looping

I'm in the process of creating a program that reads data from an external file, compares it with other data within the file then prints the results to a new external file. I am having problems with the while loop section of my code. I am unsure…
Nathan Farren
  • 23
  • 1
  • 7
0
votes
1 answer

Duplicate record from file input

i got a problem over there. When i use the function below, i got a duplicate of the last entry in my agenda (array of records, "contact"s). How can i resolve this problem? Sorry if i asked a Q previously answered void load(agenda a,int& r){ …
Cris
  • 13
  • 1
0
votes
1 answer

C++ - Simple - nested while loops never terminate?

I'm just revising some file i/o for C++. Writing a program that prints its own source code to the terminal without comments Here are the loops in question WORKING with if statements while (!inputstream.eof()) { if(in_comment == false) { …
0
votes
2 answers

C++ Primer 1.4.4 — Importance of EOF and how to write in a code that will end without EOF?

Referring to two questions: Incorrect output from C++ Primer 1.4.4 Confused by control flow execution in C++ Primer example My question is answered in both of those posts, but I want to delve further. First, I know this is only the beginning, but…
z.lite
  • 3
  • 1
0
votes
4 answers

How to determine, inside of "while(fscanf != EOF){blah}", if the next fscanf is going to return EOF?

I've got some code executing in a while(fscanf != EOF) loop. However, even when fscanf has finished executing, I need to keep running that code until some conditions are met. I mean I guess I could copy/paste the code to outside the while(fscanf)…
paIncrease
  • 465
  • 1
  • 5
  • 18
0
votes
2 answers

Why this fscanf() segfaults when a big file is used?

I have a function that receives the name of a file as an argument. The idea is to read each word in the given file and save each one in a linked list (as a struct with a value and a pointer to the next struct). I could get it working for small…
Gabriel
  • 367
  • 2
  • 5
  • 15
0
votes
1 answer

c++ .eof. Last value of file not read

I am trying to read all of the integers from a file (can be up to 100 ints) into an array, and print out the numbers entered, and how many numbers were entered. I am having trouble with ".eof". No matter what I try, the last value in the input file…
Zach
  • 85
  • 1
  • 1
  • 9
0
votes
0 answers

Unexpected end of file from server error in netbeans

This php file will run perfect on it's own, but when it is called through ajax I get an unexpected eof error.
1 2 3
99
100