2022 Developer Survey is open! Take survey.

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).

Filter by
Sorted by
Tagged with
3 votes
1 answer
47 views

improved "tee" utility

We have modified the tee program with your suggestions from the previous pull request. Did I implement well? I would like to optimize the program even more, what ...
user avatar
  • 179
1 vote
0 answers
24 views

Process a binary file by chunk using a read stream in nodejs

I want to process a file chunk by chunk to prevent memory exhaustion. I need to consume the file using a read stream. When trying it, this implementation seems to work fine. I am asking your expert ...
user avatar
2 votes
2 answers
102 views

another attempt to implement the tee command

I implemented the tee command from linux. The program implements the -a option Reads standard input until end-of-file, write a ...
user avatar
  • 179
1 vote
1 answer
56 views

Passwords with C++ Console

I am really, really new to coding in general and especially c++. To get more familiar with c++ I am trying to do a series of projects with c++ console apps. One of my projects is with a database that ...
user avatar
3 votes
3 answers
94 views

tee: copy standard input to both stdout and a file

I implemented the tee command from linux. The program also handles the -a option for adding text to the end of a file if it ...
user avatar
  • 179
5 votes
0 answers
65 views

A POSIX getdelim() and getline() implementation for MSVC

Tired of always having problems in reading arbitrary length lines from file under Windows, I tried to write a POSIX getdelim() and ...
user avatar
4 votes
2 answers
75 views

Read a file format with mixed CSV and non-CSV content

I have a file format that I need to read which contains blocks of CSV data interspersed by non-CSV (or at least, inconsistent CSV) lines. Other than the very first line of the file (which has comma-...
user avatar
  • 263
1 vote
0 answers
28 views

A Command Line To-Do List (CLI) application written in NodeJS

I wrote this code for myself so I can manage my personal to-do list easier. Considering, I spend most of my time in the terminal, it made sense. I have worked on the project as a way of practising my ...
user avatar
  • 11
1 vote
1 answer
49 views

C++ intializing and saving mp4 ftyp box struct byte by byte

I'm unsure whether the way I'm performing initialization is recommended, and whether there is a simpler way to save out a struct like the one I'm using. The main points of feedback I'm looking for are ...
user avatar
3 votes
1 answer
50 views

Quickly read numeric input

Do you have any criticisms or corrections or improvements? I need to read only numbers(and this numbers could be from 0 to 1000000) ...
user avatar
1 vote
2 answers
98 views

Function that behaves as dup2

I am reading the book Advanced Programming in the UNIX Environment and I have tried to solve the following exercise: Write a function that performs the same actions as ...
user avatar
  • 1
3 votes
2 answers
113 views

Retry read/write until all bytes are transferred or error occurs

Currently I have a wrapper function for the read/write system calls, the purpose of which is to eliminate partial transfer ...
user avatar
3 votes
1 answer
135 views

get_line(): An alternative implementation of standard C library's getline() function

get_line(): An alternative implementation of standard C library's getline() function. Syntax: char *get_line(int fd, int *error_num); I know that I can declare/...
user avatar
6 votes
1 answer
168 views

Decompress tar.gz file in Go

I want to extract tar.gz file and store the contents in the same directory. I got below method which does the job but I wanted to see if there is any way to improve ...
user avatar
  • 169
5 votes
1 answer
407 views

C# Async FileInfo Extensions (Copy, Move, Delete)

Here is my effort to implement extensions for FileInfo object: ...
user avatar
  • 151
3 votes
4 answers
466 views

Generate HTML select tag and options using a text file having list of countries

The code below will generate an HTML select tag and options using a text file having list of countries. If the file doesn't exist or contains only empty / white space lines then generate an input box ...
user avatar
5 votes
1 answer
191 views

Optimized way to save list of files

I would like to optimize the way that I save files. Each second I save lots of strings in different files. What I want to do is bunch up these IO tasks so they happen in bursts, instead of spread out ...
user avatar
  • 103
4 votes
1 answer
257 views

Iterate through non-empty words from text files

Given a file or directory, create an iterator that returns the non-empty words from the file or from all files recursively in the directory. Only process ".txt" files. Words are sequence of ...
user avatar
6 votes
3 answers
2k views

Reading 100,000 data files in Python

I need to manipulate data found in multiple data files (~100,000 files). One single data file has ~60,000 rows and looks something like this: ...
user avatar
1 vote
2 answers
106 views

File reader and writer

I was told that the following code of mine was poorly written. How bad is it? Do you have any recommendations? ...
user avatar
7 votes
2 answers
264 views

Word wrap with file input & ouput

As this is a very basic word wrap program, it has at least the following 3 limitations :- The file should have a terminating newline. The column number at which the lines are to be wrapped must be ...
user avatar
2 votes
1 answer
96 views

C++ simple type serialization for streaming primitive- / pod types over a web socket (e.g. asio)

I am experimenting with asio web sockets and tried to write a simple serializer / deserializer. I am also thinking about an approach on how to serialize some type information alongside the actual data....
user avatar
  • 143
0 votes
1 answer
34 views

how to make inputs work well with special characters using the locale.h library? [closed]

for some reason the function setlocale(LC_ALL, "English") doesn't work when using an input function,(getchar, scanf, fgets,..), to get a special character, (Ç, ã, õ, é,...). ...
user avatar
7 votes
3 answers
712 views

Input validation

I am learning C from C Primer Plus, and am still a beginner. I have been introduced to only two functions for input, scanf() and ...
user avatar
3 votes
3 answers
284 views

Efficiently read a file into a (C) string using POSIX APIs

Exactly what the title says, this is a C++ class that attempts to read a file into a null-terminated string as efficiently as possible, using POSIX APIs. Obviously this is not intended to be portable ...
user avatar
  • 258
2 votes
2 answers
1k views

Filtering FASTQ file based on read names from other file (how to increase performance) Python

I have some code here that basically takes in a list of IDs (sequencing read names) using STDIN, and then filters fin (a gzipped FASTQ file) to just those reads ...
user avatar
  • 362
0 votes
2 answers
60 views

Getline function

The following is my attempt at writing a getline() function that makes it a bit easier to work with. I suppose an easier way would be to use ...
user avatar
  • 333
4 votes
4 answers
831 views

Limit fgets input to up to a certain number of characters

This question is an extension of this other question from Stackoverflow. The objective is to limit the input of characters read by fgets to up to a certain number of characters. And in the following ...
user avatar
  • 141
0 votes
1 answer
272 views

Import XML files to MongoDb with Nodejs

Here is my code which will read XML files and import the data to MongoDb. Do you have any comments on my code? ...
user avatar
1 vote
1 answer
517 views

Read and sort 100 numbers from a text file

The program itself reads 100 values from a text file named input.txt. Then sorts those values in ascending order and writes the values to a new file called ...
user avatar
5 votes
1 answer
170 views

Binary IO inspired by struct pack

About I'm writing a header-only template library for helping with binary IO. It is inspired by pack-d, which is in turn inspired by Python's struct module. I've only finished the output part and ...
user avatar
2 votes
1 answer
164 views

Network library based on boost::asio

I'm currently trying to develop an easy to use TCP networking library based on boost::asio. This is my first attempt to work with ...
user avatar
  • 21
1 vote
1 answer
76 views

A calculator in C without #include

I made a calculator in C without #include. Now, I want to make my code shorter and better. But I don't know how. Here is my code: ...
user avatar
  • 9
0 votes
3 answers
196 views

A calculator in C++

I want to make my calculator code shorter. Here is my code: ...
user avatar
  • 65
4 votes
1 answer
96 views

Processing delimiter characters in C?

Write a C program that will implement the basic operations of table processors. The input will be text data read from a .txt file, operations will be defined using terminal arguments, and the output ...
user avatar
  • 43
3 votes
2 answers
134 views

NinjaTrader - Writting to MemoryStream then to Disk

I would like to make the below code more efficient by writing all text(CSV) to memory before writing to disk. The CSV file could have upwards of 10,000 or rows. With the current code, it opens and ...
user avatar
  • 33
4 votes
2 answers
416 views

FileParsing in C

So I have a text file filled with old onion links and its incredibly messy: ...
user avatar
-1 votes
1 answer
259 views

Is performing IO in constructor good idea? [closed]

I have Java (or C#, Python, Kotlin, or other similar language) class that will be used to communicate with client over network. Protocol used by this application allows many different ways to create ...
user avatar
  • 127
5 votes
1 answer
53 views

A Program that gets text from a client and puts it into a file on a server

I recently created a program that could get information from a client, a name and some text, and then put that into a text file. From there the user can get open the text file straight from the ...
user avatar
6 votes
1 answer
123 views

upload multiple images and resize

I've written PHP code to upload multiple images to a server. This function processes a maximum of 10 images at one time and if any image's width or height is larger than 2000px it will resize it. But ...
user avatar
  • 61
6 votes
3 answers
2k views

Conversion into hexadecimal using C++

I want to read a vector of eight bytes, convert them into hexadecimal, store them in a std::string and finally write them into a binary file. I am looking for ...
user avatar
  • 63
3 votes
2 answers
3k views

Async file copy/move

My effort to write async methods for copy/move a file in C# ...
user avatar
  • 155
4 votes
2 answers
230 views

Reader for graph-file with ugly return and questionable use of streams

I wrote a class that contains a static method that reads in files from NetworkRepository and converts them into a list of integer-arrays, each representing an edge. The file format from ...
user avatar
3 votes
0 answers
63 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 ...
user avatar
  • 31
2 votes
1 answer
62 views

RemoteFile in Java - follow-up

(See the first and initial iteration at RemoteFile in Java.) I have added some new facilities for convenience. Now I have this in mind: com.github.coderodde.utils.io.RemoteFileDownloadListener.java: ...
user avatar
  • 25.3k
2 votes
1 answer
300 views

RemoteFile in Java

(Also, see the next iteration.) I have this tiny class for downloading files from internet: ...
user avatar
  • 25.3k
7 votes
2 answers
75 views

Skip input to next line, for reading serialized objects

I was de-serializing objects that had an extra newline that needed to be removed before getting the next object. ...
user avatar
  • 91.5k
4 votes
1 answer
166 views

C functions for fast IO for competitive programming

In some (perhaps not well-designed) competitive programming problems, the runtime and score is dependent on how fast your program can process input. Therefore I've written a small C99 library with ...
user avatar
3 votes
1 answer
138 views

Read file only once

I have a function that returns the contents of a file. Since reading files from disk is expensive, I'd like to avoid having to read the file again after the first read. I've come up with the ...
user avatar
1 vote
1 answer
58 views

Test a single-line file for punctuation and newline [closed]

I have written the following program to read from a file (entire input in single line) and check for: ASCII punctuation characters a final newline ...
user avatar

1
2 3 4 5
10