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
2 answers

Can Haskell make distinctions for different kinds of IO

Disclaimer: My ignorance about Haskell is almost perfect. Sorry if this is really basic, but I couldn't find an answer, or even a question like that. Also my English is not that good. As far as I understand, if I have a function in a system that…
Pablo Grisafi
  • 5,039
  • 1
  • 19
  • 29
6
votes
1 answer

Why fetching data from Memory & I\O is expensive?

When I read operating system based books everywhere its written that fetching data from memory and I\O (subsystem) is expensive considering time constraint and over-heads are high, and that's why in some hardware manufacturer provide some other way…
user3405841
  • 1
  • 1
  • 8
6
votes
3 answers

StringScanner scanning IO instead of a string

I've got a parser written using ruby's standard StringScanner. It would be nice if I could use it on streaming files. Is there an equivalent to StringScanner that doesn't require me to load the whole string into memory?
jes5199
  • 18,324
  • 12
  • 36
  • 40
6
votes
1 answer

I want to serialize and deserialize a ArrayList but I keep getting warning?

I want to serialize and de-serialize an Array of Employees into and out of a file. I keep getting a Type Safety warning on my compile and run. Is there a better way to do this than the way that I did it. I want to be able to write the entry…
Doug Hauf
  • 3,025
  • 8
  • 46
  • 70
6
votes
2 answers

Prolog - unexpected end of file

Reading a file in Prolog error Hi, I'm working on a Prolog project and I need to read the whole file in it. I have a file named 'meno.txt' and I need to read it. I found some code here on stack. The code is following: main :- open('meno.txt',…
user3568104
  • 93
  • 1
  • 2
  • 7
6
votes
3 answers

Advanced Reading of File

I'm sure we're all familiar and probably use the plethora of code provided in books, online, etc. in reading a file using C#. Something as simple as... StringBuilder fiContents = new StringBuilder(); using (StreamReader fi = new…
user1092809
  • 107
  • 1
  • 7
6
votes
2 answers

Opening already opened file does not raise exception

Consider those two python programs: script_a.py: from datetime import datetime from time import sleep while True: sleep(1) with open('foo.txt', 'w') as f: sleep(3) s = str(datetime.now()) f.write(s) …
soerface
  • 6,417
  • 6
  • 29
  • 50
6
votes
4 answers

How to forcefully unlock a file in c#?

I need to delete a file. Occasionally, the file may be locked, in this case I'd like to unlock it and delete it anyway. I've come across two possibilities in the research so far. System.IO.FileStream.Unlock and //unlock…
alchemical
  • 13,559
  • 23
  • 83
  • 110
6
votes
3 answers

Reading Really big Files With Java

I am reading a 77MB file inside a Servlet, in future this will be 150GB. This file is not written using any kind of nio package thing, it is just written using BufferedWriter. Now this is what I need to do. Read the file line by line. Each line…
PeakGen
  • 21,894
  • 86
  • 261
  • 463
6
votes
3 answers

Why is it necessary to flush the output buffer when it was just created?

In the following scenario ObjectOutputStream output = new ObjectOutputStream(socket.getOutputStream()); output.flush(); // Do stuff with it Why is it always necessary to flush the buffer after initial creation? I see this all the time and I don't…
krystah
  • 3,587
  • 2
  • 25
  • 43
6
votes
11 answers

Getting an 'out of memory' exception in this relatively simple program

Here's my Picture.cs class: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO; using System.Drawing; namespace SharpLibrary_MediaManager { public class Picture:BaseFile { public…
delete
6
votes
2 answers

Why is `pickle.dump`+`pickle.load` IPC so slow and are there fast alternatives?

I am doing IPC with a python subprocess. For now, let's assume I have to use subprocess.Popen to spawn the other process, so I can't use multiprocessing.Pipe for communication. The first thing, that came to my mind is to use their STDIO streams with…
coldfix
  • 6,604
  • 3
  • 40
  • 50
6
votes
1 answer

Deleting items in stdin with haskell

I have a bit of code in my haskell program like so: evaluate :: String -> IO () evaluate = ... repl = forever $ do putStr "> " >> hFlush stdout getLine >>= evaluate Problem is, when I press the delete key (backspace on windows), instead of…
limp_chimp
  • 13,475
  • 17
  • 66
  • 105
6
votes
1 answer

Haskell - putStr vs putStrLn and instruction order

Let's say we have a short haskell programm: main = do putStr "2 + 2 = " x <- readLn if x == 4 then putStrLn "Correct" else putStrLn "Wrong" What output does it produce? 4 2 + 2 = Correct Now let's…
User1291
  • 7,664
  • 8
  • 51
  • 108
6
votes
2 answers

Buffer size in Java

I have got a little question about buffer size in Java. Why do we set buffer size to 1024 or 2^n. For example: inputStream = file.getInputStream(); File newFile = new File("C:/uploads/operators.xml"); outputStream = new…
Tony
  • 3,605
  • 14
  • 52
  • 84
1 2 3
99
100