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

detect incomplete 32 bit binary data

I have a binary file from which I need to read 32 bit patterns- In the event if the EOF is reached such that its less than 32 bits - I need to error out saying unexpected eof else just break. I tried a lot but I am unable to get the incomplete bytes…
oneday
  • 629
  • 1
  • 9
  • 32
0
votes
1 answer

A loop to read characters from console till EOF character is encountered using getchar() is not exiting when EOF character is encountered

Here is program to read character from the console and print them in a reverse order. #include main() { int ch, count = 0; char a[100]; printf("Enter Charachters\n"); ch = getchar(); while(ch != EOF && count<100) { a[count] = ch; count…
0
votes
0 answers

Getting infinite "wrong answer" as output on ideone

import sys def carton(x): bottle=x/10 rem=x%10 if rem > 7: bottle = bottle + rem + 1 elif rem == 7: bottle = bottle + 1 elif 5
0
votes
1 answer

losing data when reading a file with fscanf

using a part of code like this: fscanf(f1, "%d", &n); while(!feof(f1)){ ... fscanf(f1, "%d", &n);} it misses the last line of the file (meeting EOF). How should I solve? the only solution i found is: if (fscanf(f1, "%d",…
StackUser
  • 1,530
  • 3
  • 13
  • 17
0
votes
1 answer

peek() behavior in istringstrem class

I saw a lot of questions on the peek method, but mine concerns a topic which would be almost obvious, but nevertheless (I think) interesting. Suppose you have a binary file to read, and that you choose to bring up it as a whole in the program memory…
GSi
  • 649
  • 3
  • 10
0
votes
1 answer

windows docker pull EOF

I installed boot2docker on Windows and I am having problems pulling images. I get an EOF error both when directly pulling and when trying to run directly (in that case Docker guesses it has to pull an image). Any ideas why this might be? I put my…
Felipe Gerard
  • 1,552
  • 13
  • 23
0
votes
1 answer

Two commands in one script ubuntu terminal

I have two commands: #!/bin/bash python /srv/django/manage.py shell; execfile('/home/usr/myscript.py') I want to use them in one script scr.sh. However as it is, I get errors. CommandError: Command doesn't accept any arguments …
user65165
  • 874
  • 1
  • 8
  • 11
0
votes
1 answer

"Unexpected EOF while parsing" while storing in file

I am trying to parse data from server and want to store it in file but I am getting Unexpected EOF while parsing. I am very newbie on python. Here is my code. import requests from bs4 import BeautifulSoup url = "http://www.couponindia.in/"; r=…
Sandip Armal Patil
  • 6,241
  • 21
  • 93
  • 160
0
votes
3 answers

What is EOF and what is its significance? How can it be noticed?

While studying getchar() function in C ,I came across this EOF being returned , I want to know how can its existence be noticed, where is it stored? Can we type EOF character explicitly?
Amisha Bansal
  • 11
  • 1
  • 4
0
votes
2 answers

Equivalent of RecordSet.MoveNext while Not EOF in ASP.NET

I'm using a DataReader to display informations stored in a table. I created Two button to go to next record and to go back. In VB6 I used this code : While Not Recordset1.EOF Recordset1.MoveNext End While In ASP.NET I didn't find a way to do like…
Wassim AZIRAR
  • 10,823
  • 38
  • 121
  • 174
0
votes
0 answers

'Fake' end of line (EOF)

I am decrypting a file that apparently contains end of line prior to the actual end of file and I can't seem to find a solution to it. Does anyone have an idea how to keep it as a byte to be decrypted and continue reading until the next EOF? EDIT: I…
Slavi
  • 120
  • 4
  • 15
0
votes
1 answer

EOF Batch error

Impossible to run a batch alter table in cqlsh. cqlsh:test> create table mytable (id int PRIMARY KEY, comment text); cqlsh:test> begin batch alter table mytable add testcol text; apply batch; SyntaxException:
0
votes
5 answers

Java end of file

import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner line = new Scanner(System.in); int counter = 1; …
G V Sandeep
  • 226
  • 1
  • 4
  • 14
0
votes
0 answers

eof loop not breaking

I am making an inventory management system, its just starting of my program. I have a problem with this code. When I start program and display objects its works correctly but after that when I again press 2 for display loop didn't break. …
0
votes
0 answers

Expect Script: Interrupted and Successful Connections both returns EOF

I'm trying to push a set of commands to Cisco devices. The last command, obviously is "exit". How can I determine the difference between the two since both of them can be tracked through eof. All commands have been pushed successfully. The…
rjma30
  • 53
  • 1
  • 6