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.
17,503
questions
-1
votes
1
answer
29
views
BIO、NIO or AIO to transfer files [closed]
I want to transfer files between two Linux servers, which IO model would be better with BIO、NIO、AIO
the way I use now is BIO with Socket and SocketServer. I need to transfer many files(maybe 70 small ...
0
votes
0
answers
31
views
Pre-filling a prompt in Rust [duplicate]
This question has been asked before for Bash and Ruby, but I can't find any information for Rust.
I have a string that needs to be changed very slightly, so I want to be able to pre-fill it in the ...
0
votes
1
answer
42
views
Create ZipFile with password without external libraries C#
As the title says, I need to create a zip file secured with a given password but I have the constraint of don't use any external library. I have to use only .NET Framework 4.6.1
Currently, I'm ...
0
votes
1
answer
42
views
Read, encrypt, zip and send a file without rewriting it
I have a to read a file, zip it, encrypt it with AES algorithm and send it to an S3 bucket.
The workflow of my actual code is :
Read file and write it as a zip file (Files.copy(filePath, ...
0
votes
2
answers
42
views
How to iterate through text file with whitespace and newlines, perform a function upon each string, and print out again in the original format?
I need to go through a text file in a similar format as follows:
fire dwarf stone
rock beer arrow lion
sword shield
archstone
dragon gold
silver
hall
goblet chest axe
Axe has a newline after it("...
0
votes
1
answer
40
views
Can't read file in Lua after I moved the .love file elsewhere
So I zipped my Love2D project and it works when I launch it in the same folder, but elsewhere my io.open doesn't work. Here's my file system:
...
utils
|json.lua <-- library I use for encoding ...
0
votes
0
answers
9
views
How to enable mic without muting sound in windows 10?
I'm creating an app that plays a set of video clips or slides sequentially, advancing each time the user speaks "next" into the mic, replaying the clip or slide when the user says "...
-1
votes
0
answers
11
views
Read book information (id, name, price, qty) in file “book.dat”. search book by name
I am wrote the program but book is not displayed.
I open file using RandomAccessFile and I created read string method using byte array. I think my file not opening or data of the file is not read ...
0
votes
0
answers
8
views
How to estimate the number of IOs in mysql [migrated]
Suppose I have a table with fields id and b, and create a non-clustered index b. The tree of index b is 3 levels high. I select * from table where b < 1000 and need to return the table. How to ...
0
votes
0
answers
39
views
I am curious about a part of the file I/O code in the Linux kernel
I have a question regarding Linux file I/O.
When writing to a file, the kernel uses the generic_file_aio_write() function in which
mutex_lock(inode->mutex);
The code runs. (https://elixir.bootlin....
-1
votes
1
answer
59
views
How do I get Java to output to where my focus is? (example: open text document)
I used jnativehook.keyboard.NativeKeyListener to listen to keys typed in an open text document. No problem here.
After a short permutation (think Caesar cipher), I want to send the output back to that ...
1
vote
0
answers
16
views
Do POSIX writes block until the DMA device has finished writing data?
I am wondering whether standard POSIX write-calls (with blocking I/O) do block until the DMA device is done transferring the data to the disk or only wait until the necessary information about the ...
0
votes
0
answers
12
views
Prolog: How do I make repeating print/input statements?
I'm using SWISH Prolog to create a 'chatbot' that stops when the user writes "quit." So far this is my code:
chat :-
write('hello I am a chatbot'),
nl,
write('when you see "...
1
vote
1
answer
36
views
What is the advantage of using kernel level buffering for writing files
I am currently on optimizing the writing speeds for my application and have the possibility to set the file-system buffersize (kernel level) as well as the buffered i/o buffer size (user level). My ...
-1
votes
0
answers
33
views
Python file.writelines() writing same texts multiple times
My code :
import os
f = open('ConClusion.txt', 'a')
file = '\solutions\Fans.txt'
path = os.getcwd() + file
files = open(path, 'r+')
new = ''.join(files.readlines())
f.writelines(new)
print('complete ...
0
votes
1
answer
39
views
How to solve "MemoryError" when download dataset by kaggle?
I want to download dataset from kaggle, however when I run it on my local machine, it crashed, and this is my code:
api = kaggle.KaggleApi(json_str)
api.authenticate()
api.datasets_download(...
-2
votes
1
answer
27
views
Why there is not my file in runner directory on Github Action?
I want to download kaggle's dataset automaticly on Github Action's server, and this is my code:
json_str = '{"username":"headwater","key":"My key"}'
if ...
1
vote
0
answers
14
views
Netty - Not receiving new message when not calling writeAndFlush with ByteBuf of channelRead
When I pass data to const ProxyServerHandler, everything works as usual.
But when I pass activeBuffer, then netty appears just stuck there, channelRead won't be fired again.
private ByteBuf ...
0
votes
0
answers
45
views
How does the operating system handle I/O writes, that are not a multiple of the block device's sector-size?
I am trying to understand how a data-block, that is not a multiple of the drive's default sector size is written down.
In my understanding, the operating system can only do block-device actions of a ...
-2
votes
2
answers
54
views
Best way to interact with I/O bound threads to produce 100 GB random data in C# using TPL [closed]
I need to produce a 100GB file with random data. I know it's all I/O intensive operation apart from a few lines that are just generating random data.
My target is to create 100 GB or 50 GB files. I ...
-3
votes
0
answers
57
views
How to write billions of randomly generated data records to a file in most quickest way using TPL in C#
I am trying to generate the random data that needed to be written in most quickest manner to the file. The target file data could be 100GB. It could also be 50 GB or less as well.
So, I am using all ...
0
votes
0
answers
23
views
powershell : a way to get real IOPS generated by script
I am working on performances issue on scripts that are slow when logging on a remote share.
Is there a command that get a count of real I/O sent to the disk system ?
Lots of scripts exists to mesure ...
0
votes
1
answer
51
views
how to avoid oom when direct return InputStream using quarkus
First, I obtained the target file to be downloaded through Minio like this.
public GetObjectResponse getFile(String bucket, String object) {
validateEnableMinio();
try {
...
1
vote
2
answers
55
views
python asyncio is much slower than threads when reading files from hard disk
There are about 1M images, I need to read them and insert the bytes into redis with python. I have two choices, the first is to use a thread pool, and the second is to use asyncio, since this is only ...
0
votes
0
answers
15
views
GC.GetTotalMemory(false) returns very less memory in comparison with TaskManager reports
I am writing an ExternalMergeSort algorithm for sorting really huge files ( i.e. probably 20 50 GB or even 100 GB / of text files ).
For this reason, I need to split the files into equivalent chunks ...
0
votes
0
answers
29
views
Server reading from the socket's input stream only if it has data
I'm trying to implement a ridiculously simplistic chat client and a chat server. My goal is to learn to get comfortable with Sockets rather than come up with a reasonable chat implementation. However, ...
0
votes
1
answer
52
views
MOJO: How do I convert StringRef to Int?
from sys import argv
fn fibonacci(n: Int) -> Int:
if n == 0:
return 0
elif n == 1:
return 1
return n + fibonacci(n-1)
fn main():
var vls: StringRef = argv()[0]
...
0
votes
0
answers
22
views
Is there any way to store a value in a separate entity?
I'm trying to show a non-specific counter in my website (hosted on AWS, which takes the code from the github page containing all the files), one that possibly, I'd be able to edit (increment/decrement)...
0
votes
0
answers
40
views
Try with resources with multiple resources
I am trying to use try-with-resources with the code below
try {
FileOutputStream fileIn = new FileOutputStream("veri.obj");
ObjectOutputStream objectIn = new ObjectOutputStream(...
0
votes
1
answer
23
views
What should be the right SplitSize (Chunk) for a external merge sort?
I am using an existing code of External Merge Sort algorithm.
This algorithm must be able to handle large files ( i.e. 10GB, 20 GB, and even more )
The available memory can be 15 GB or 10GB ( as it ...
0
votes
2
answers
63
views
How to include snprintf without syscalls needed for printf?
On an embedded platform, the syscalls needed for printf aren't usually available. The standard solution is to write simple stubs e.g. for _write.
I don't need or want printf. I need snprintf for ...
0
votes
0
answers
35
views
How to check if any IO stream is open and forcefully close it in Java
So I am making an archiver application using Spring boot, whenever application should start, fetch data from database , uploads to S3 and it should goes down automatically.
So, I used below property ...
-2
votes
1
answer
32
views
Put a mutable buffer of u8 into BufReader.read()
Follows on from this partial answer to my question there.
I'm basically trying to understand how a particular manifestation of BufReader works, which is not std::io::BufReader.
The puzzling thing is ...
0
votes
0
answers
37
views
iOS write & read the same file
Dears,
this is such an obvious case that I'm sure I have misunderstood something but can somebody explain to me why such a simple write to file and re-read the same file fails ?
Of course this is not ...
0
votes
0
answers
37
views
pyserial cannot convert string to float ''
Here is some code I am working on. The idea is to use a remote serial terminal to send servo angles to it and have it report the current position of the servo at regular intervals.
#!/usr/bin/python3
...
0
votes
1
answer
18
views
Trying to prepend or modify existing line is overwriting part of the next line
I have a main file and a temp file. In both files are records following the format (colons and |'s included)
Name:<name>|Field1:<int>|Field2:<str>|Field3:<str>|LockPID:<...
-1
votes
0
answers
70
views
podman image build - gives consistent error
I have tried to build images with four different applications in Alpine Linux over the past three weeks, and I always get the same error:
error running container: from /usr/bin/crun creating container ...
1
vote
1
answer
30
views
When I use File.Move, its called twice and causes errors
The issue I am having is when I try to move a file to a different directory, I get an error saying the file doesn't exist in the current directory where you want to move it from. However, when I check,...
1
vote
0
answers
28
views
Lua how to enter non English symbols in io.read()
I have code that runs some commands, i have io.read() that has to read user input and understand which command user used(or not used), and i have an issue when i enter "шлях"(path on English)...
-1
votes
0
answers
35
views
Can I use GTH/GTY pins as user-defined?
I'm trying to explore Zynq UltraScale+ posibilities. As I understand GTH/GTY are indepent PL blocks. And reference manual of Zynq UltraScale+ says "The GTH and GTY transceivers are configured ...
1
vote
0
answers
36
views
Octave keeps crashing on start-up
I tried to install the io package ( https://octave.sourceforge.io/io/index.html ) from the octave command window, for some reason this didn't work the 1st time and Octave just crashed. I restarted ...
-1
votes
3
answers
67
views
What's a more efficient Pythonic method to read a file line-by-line while tracking line offsets for future reference?
I want to read a file line-by-line, noting the file offset of each line so I can go back to it later.
I'm doing it manually like this:
while True:
offset = ifile.tell()
line = ifile.readline()
...
0
votes
0
answers
38
views
Are conflicts possible when writing multiple separate files using foreach R parallel?
Since I cannot provide a reproducible example I will give you a description.
I need to process some thousand images with an image editing software (i.e. Rawtherapee).
In essence, I am using foreach in ...
2
votes
1
answer
50
views
Netty offload Async calls of Third-Party Libs to OS
Trying to figure how will my Async calls to Third Party Libs get offloaded to OS,
Netty has Boss threads that are used to accept incoming connections but the processing of a connection is handed off ...
0
votes
1
answer
63
views
Is there a way to set absolute cursor position for uinput virtual device (Wayland)?
I followed the code example on the linux uinput documentation in order to simulate a virtual pointing device. I have the following lines of code which can successfully move the cursor down and to the ...
1
vote
1
answer
42
views
Boost asio multi threaded application serializes the timer callback
I have below application running on linux with boost library version 1.79.
The code is based on boost example taken from here
void worker(io_context& ioContext) {
std::cerr << "...
0
votes
0
answers
19
views
Avoid read/write from two python scripts on two linux screens
I have one script that is called data_extractor.py that continuously downloads data from a public api, and saves the data in feather files.
I have another script that loads those feather files in ...
0
votes
0
answers
30
views
.NET 6 long busy wait on IO operations instantly completes when memory dump is taken
The program uses the Faster library to store some kv and spilling to disk.
The code is trying to wait for Faster to complete any pending operations after writing all the entries with a timeout. It ...
0
votes
2
answers
73
views
What the purpose of 'bufp += nread;' in the Robust reading rio_read() function?
I'm reading the code below in Chapter 10 in the book called Computer System: A Programmer's Perspective. I understand all the code below except the line: bufp += nread; I found this line is pointless, ...
0
votes
0
answers
21
views
keyring error when importing: module 'io' has no attribute 'text_encoding'
When importing keyring,
import keyring
for some reason I keep on getting error message: "AttributeError: module 'io' has no attribute 'text_encoding' "
the line preceding the error refers ...