Questions tagged [io]

In computing, input/output, or I/O, refers to the communication between an information processing system (such as a computer), and the outside world, possibly a human, or another information processing system.

In computing, input/output, or I/O, refers to the communication between an information processing system (such as a computer), and the outside world, possibly a human, or another information processing system.

(Source: Wikipedia [Input/Output])


I/O includes tasks such as:

  • Reading and writing files ()
  • Interacting with a user through a command-line terminal session ( / / )
  • Connecting programs so that one sends its output to the next (s)
  • Sending data over a network in packets or as a data stream ()

For the Io language, see

17482 questions
6
votes
4 answers

Why am I throwing a NullPointerException

So it's winter break for colleges, and I'm trying to stay sharp on my coding, so I'm just writing code for programs and algorithms we only talked about but never coded in class. Anyway, one I'm working on today is a program where you give the…
Bill L
  • 2,576
  • 4
  • 28
  • 55
6
votes
1 answer

I/O-mapped I/O - are port addresses a part of the RAM

In I/O-mapped I/O (as opposed to memory-mapped I/O), a certain set of addresses are fixed for I/O devices. Are these addresses a part of the RAM, and thus that much physical address space is unusable ? Does it correspond to the 'Hardware Reserved'…
Cygnus
  • 3,222
  • 9
  • 35
  • 65
6
votes
1 answer

How to resume input stream after stopped by EOF in C++?

I want to write a program so that it takes two sets of integer input from terminal and computes two sums. My intention is to separate the two sets of input by EOF (pressing Ctrl+D). Here is my code: #include using namespace std; int…
God_of_Thunder
  • 753
  • 3
  • 20
  • 46
6
votes
1 answer

how virtio front-end drivers to share vring (or virtqueue) with qemu?

i'm studying how virtio works with qemu and kvm. And i have two questions. so far, i understood virtio frond-end drivers (in guests) write IO requests in vring(virtqueue) and kick qemu. Then qemu is notified, translate requests in vring and invoke…
user3089142
  • 61
  • 1
  • 2
6
votes
3 answers

haskell piping strings into IO

Sorry if this is a common question. I have this simple IO() function: greeter :: IO() greeter = do putStr "What's your name? " name <- getLine putStrLn $ "Hi, " ++ name Now I want to call greeter and at the same time specify a parameter that…
user2744010
  • 453
  • 2
  • 6
6
votes
2 answers

get file cursor position in C

I am reading a file with fgetc, so each time it reads a character, the cursor positio gets changed. Is it possible to know, after each read, the "coordinates" of the cursor on the file in terms of column and line number? Thanks
asdf
  • 2,281
  • 5
  • 28
  • 29
6
votes
4 answers

Reading specific rows of large matrix data file

Suppose I have a gigantic m*n matrix X (that is too big to read into memory) and binary numeric vector V with length m. My objective is to read the rows of X that correspond to V equalling 1 (and not those corresponding to V[i] == 0) into a…
user2763361
  • 3,789
  • 11
  • 45
  • 81
6
votes
2 answers

Hadoop MapReduce read the data set once for multiple jobs

I have a dataset formed by lots of small files (average 30-40 MB each). I wanted to run analytics on them by MapReduce but with each job, the mapper will read the files again which creates a heavy load on I/O performance (overheads etc.). I wanted…
Engin Sözer
  • 97
  • 1
  • 6
6
votes
2 answers

Python 3. Need to write to a file, check to see if a line exist, then write to the file again

I recently recovered a ton pictures from a friend's dead hard drive and I decided to wanted to write a program in python to: Go through all the files Check their MD5Sum Check to see if the MD5Sum exists in a text file If it does, let me know with…
godofgrunts
  • 262
  • 3
  • 12
6
votes
3 answers

Stream based parsing and writing of JSON

I fetch about 20,000 datasets from a server in 1,000 batches. Each dataset is a JSON object. Persisted this makes around 350 MB of uncompressed plaintext. I have a memory limit of 1GB. Hence, I write each 1,000 JSON objects as an array into a raw…
Guarana Joe
  • 723
  • 1
  • 7
  • 16
6
votes
1 answer

Why callbacks are "ugly"?

Lately I've listened to a talk by Guido van Rossum, about async I/O in Python3. I was surprised by a notion of callbacks being "hated" by developers, supposedly for being ugly. I've also discovered a concept of a coroutine, and started reading a…
rincewind
  • 1,103
  • 8
  • 29
6
votes
2 answers

Java getting file as resource when it's in the project folder

I currently have a project in Java set up with the following directory structure in Eclipse: And in my code I have the following lines: InputStream is = this.getClass().getClassLoader().getResourceAsStream("resources/config"); BufferedReader…
Giardino
  • 1,367
  • 3
  • 10
  • 30
6
votes
2 answers

How to do complex IO processing and implicit cache in Haskell?

In bigger applications there are very often multiple layers of IO caching (Hibernate L1 and L2, Spring cache etc.) which usually are abstracted so that caller needs not to be aware that particular implementation does IO. With some caveats (scope,…
Rumca
  • 1,809
  • 12
  • 17
6
votes
2 answers

C/C++: Flush output before abnormal termination

Is there a need to explicitly flush output streams before calling abort() to avoid loss of output? As I understand, with stderr there is no buffering, so calling abort after output to stderr/cerr should be ok. How about stdout/cout, or files that I…
user2052436
  • 4,321
  • 1
  • 25
  • 46
6
votes
2 answers

Haskell: Trapped in IO monad

I am trying to parse a file using the parseFile function found in the the haskell-src-exts package. I am trying to work with the output of parseFile which is of course IO, but I can't figure out how to get around the IO. I found a function liftIO…
user2548080
  • 187
  • 7
1 2 3
99
100