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 display, an information storage system, or another information processing system).

29 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
11
votes
0answers
430 views

Idiomatic way to implement `tail -f` in clojure

Disclaimer: This is just an educational task to learn how to program in Clojure and switch brain to immutable state-way of developing (the provided snipped has some unused variables which I didn't ...
6
votes
0answers
138 views

Positioning a file pointer with MPI I/O

This toy code uses MPI I/O to read from a binary file. It goes through reading: an ASCII header the first 10 doubles from an array of 100 ...
5
votes
0answers
171 views

Easy bitset IO v2

In a previous question I posted a method for easy std::bitset IO on a bit-for-bit basis. This question was later followed up in another solution. Both of these ...
4
votes
0answers
67 views

Molecular .pdb File Reader in Rust

I am new to rust and wanted to get going with a medium-sized project to help learn. I've settled on creating some basic quantum mechanics code which starts with this bare-bones file reader. It takes a ...
4
votes
0answers
104 views

One interface for multiple CRUD resources

I asked about an abstraction layer for accessing files (link) a couple of days ago (I decided to not call it a follow-up anymore as there are too many changes). I tried to incorporate many of the ...
4
votes
0answers
125 views

Perl PasteBin scraper

I'd like to optimize my code and get a better of understanding of how I can perform the task I am doing better. I've only used Perl threads about 3 or 4 times now. The purpose of my script / code ...
4
votes
0answers
743 views

Error handling with C-string input using get() and getline()

I've just learned the basics of c-strings and how to read line oriented input. I noticed that fail bits are set for each function. However, not every problem sends a fail bit, so I thought this would ...
4
votes
0answers
1k views

subprocess with logging module: tee with StringIO

I've got a long-running process. Once it finishes I need the output. But the user should be informed while it's running. With the logging module I get timestamps ...
4
votes
0answers
76 views

Writing a file sequentially

I've written a procedure which allows serialized writing of a stream. I don't in any way consider this done, but this is the beginning of it. I know there are other implementations out there like this,...
4
votes
1answer
110 views

File read/write methods

I'm using some simple files for caching and some basic user data. I was first just using file_put_contens and file_get_contents, ...
3
votes
0answers
57 views

Simple beginner Rust CLI file reader that prints to stdout

Q: Am I approaching writing idiomatic Rust code correctly? Hi CodeReview, I'm a beginner Rustacean coming from Python going through Rust books (The Rust Book, Rust in Action). A lot of the beginner ...
3
votes
0answers
300 views

Python AsyncIO pipeline

I wrote a small snippet to implement asyncio Pipeline - object that connects together Layers, and lets them create and pass ...
3
votes
0answers
281 views

K&R Exercise 1-13. Printing histogram of word lengths (vertical variant)

I'm going through the K&R book (2nd edition, ANSI C ver.) and want to get the most from it. How does the following solution look to you? Note that, for the sake of exercise, I don't want to use ...
3
votes
0answers
245 views

Reading log file of subprocess

I run subprocesses with lot of output (compilation of Unity 3D projects). I use log parsers to find known issues. ...
3
votes
0answers
4k views

Golang: reading and writing files in parallel

I am trying to read a big file line by line, inspect and cleanse each row and write to either of two output files depending on the outcome. I am using channels for this. I am still quite new to this ...
3
votes
0answers
68 views

Practicing rogue-wave I/O

What I'm doing: Searching in current directory for a set of files. Filtering the set. Searching through the filtered set of files for a specific line sequence. Write to an output file that line along ...
3
votes
0answers
62 views

URL fetcher and parser for XML feeds

Here is a program that will parse and print XML feed URLs. I want to reuse most of it to add post date to each link. This adds a new concern of CLI and output formatting on top of parsing and (poor) ...
3
votes
0answers
323 views

Functionally Typed I/O Streams

I thought up a function that provides types with InputStream and OutputStream: ...
2
votes
0answers
70 views

Optimized way to save list of file

I would like to optimize the way that I save file. Actually, each few seconds I save lot of string in different files. So, I made lot of IO at the same time, instead of making a little during more ...
2
votes
0answers
69 views

Implementation of SCPI for control of test instruments

I work with electronics test equipment. I like to be able to automate tests using their remote control interfaces. I have built a pattern, a few base classes, that I can apply to all devices that ...
2
votes
0answers
37 views

Class which encapsulates related socket streams

I have a class which encapsulates stream related objects, and I have provided the method API for doing basic manipulation on the stream read/write/close, but is this a good approach? The only benefit ...
2
votes
0answers
786 views

Golang nanny process starting child process

The idea here is that my executable can be started normally (in which case it runs my business logic), or it can be wrapped in a nanny process (which starts a child process to run the business logic, ...
2
votes
0answers
111 views

Write to terminal and buffer

...
1
vote
0answers
825 views

Prompting the user to input a data value into an element in a linked list

I'm working through a practice problem that is having me build and modify a linked list over a series of steps. I am particularly interested in knowing if there's a more elegant way of prompting the ...
1
vote
0answers
97 views

Echo in Prolog with single print (new version)

In order to learn a bit more of Prolog, I implemented the echo command for SWI-Prolog. I want a correct implementation, that is, it satisfies the following requirements: It makes only one I/O call ...
1
vote
0answers
41 views

Download the contents of an HttpURLConnection while generating metadata

Working on a web crawler (again), except now I've had a lot more time to hone my skills. The largest bottleneck in my program, as is to be expected, is the actual downloading of the data, so I'd love ...
1
vote
0answers
211 views

Customized streambuffer for C++ istream

Basically I implement a traditional file-descriptor-based streambuffer for istream operations. The implementation overrides the ...
1
vote
0answers
75 views

Reading content of directory for each HTTP request

I have a piece of code written in node and I wanted to know if I am in the right direction. Basically I have a site where the homepage lists 6 vehicle cards. Every time the page is requested I do the ...
0
votes
0answers
71 views

Efficient Timeout for a blocking operation without synchronization

I'm trying to create a timeout for a blocking operation, a InputStream.read() in the specific case, using a timeout thread without synchronization. This is needed ...