21,162 questions
1
vote
1
answer
80
views
Why does np.fromfile fail when reading from a pipe?
In a Python script, I've written:
# etc. etc.
input_file = args.input_file_path or sys.stdin
arr = numpy.fromfile(input_file, dtype=numpy.dtype('f32'))
when I run the script, I get:
$ cat nums.fp32....
0
votes
1
answer
79
views
What Python exception should I raise when an input file has the wrong size? [closed]
I'm writing a Python script which reads some input from a file. The input size can be calculated using other information the script has, and the file must have exactly that. Now, if I check and figure ...
1
vote
1
answer
54
views
Is there an alternative to the err specifier in a Fortran read() statement?
In this code
read(unit,'I0',err=100) my_integer
100 error_stop "Something went wrong."
the err specifier tells the program to go to the statement labeled 100 if something went wrong in ...
0
votes
1
answer
44
views
How can I save/load a series of floating point numbers in gforth
I am looking to do floating point number file input/output in Gforth. I found this question here which converts them to strings GForth: Convert floating point number to String , but I can't see how to ...
0
votes
0
answers
91
views
How to process large files efficiently with generators in Python without memory issues?
I’m working on a data processing pipeline in Python that needs to handle very large log files (several GBs). I want to avoid loading the entire file into memory, so I’m trying to use generators to ...
2
votes
0
answers
70
views
Why is wifstream file reading significantly slower in Debug mode compared to Release?
I have text file with size ~0.5GB.
I write code to read it.
In Release mode it takes ~15sec, but in debug it's about 2 minutes. Why?
I tried #pragma optimize, but it wasn't help.
#pragma optimize( &...
0
votes
2
answers
77
views
Counting number of words, characters, and lines of a given .txt file using PyCharm
I am currently struggling to find the number of words, characters, and lines of a song in a lyrics.txt file. I was able to find number of words and lines only, but the two code blocks I have for ...
1
vote
0
answers
74
views
Windows unable to find and or remove a directory with special characters, even though it exists
(Please keep in mind this is my first post, I'm sorry If I'm missing important info)
Short:
I have a directory (& files) that have "illegal" characters in their names.
File Explorer, ...
0
votes
1
answer
42
views
In Julia, how to make PrettyTables.jl use the booktabs package?
I am using Julia and I want to export a certain dataframe as a LaTeX table. The dataframe is called portfolios and I am sharing it as a dictionary below.
Dict{String, Vector} with 5 entries:
"...
17
votes
5
answers
3k
views
Using C to create a file and write+read to it, what went wrong?
I have this C code that I am trying to use to create a file, write any arbitrary text from it, and then just print that out. When I run this the output is... less than expected. I've tried about ...
1
vote
2
answers
114
views
Why does my forked process sometimes overwrite data in a file?
I have the following C code that writes to a file from both the parent and child process after a fork(). However, the output in testfile.txt is sometimes corrupted or in an unexpected order.
I'm ...
0
votes
0
answers
73
views
Error when I am making a search of a file in NetBeans
private void SearchbtnActionPerformed(java.awt.event.ActionEvent evt) {
String answer1 = TxtFi.getText();
Scanner sc = new Scanner(answer1);
name = sc.nextLine();
try {
...
1
vote
1
answer
70
views
Allegro CL unexpected behavior of READ-SEQUENCE
I am working with Allegro CL 11.0 Express Edition on Linux (Ubuntu 16.04). I am seeing behavior from READ-SEQUENCE which is surprising to me. Is the following conforming to the CLHS? EDIT: Franz, Inc. ...
1
vote
0
answers
51
views
Go writing log file weirdly stuck in netpoll
Researching strange issue with weird delays in the app took me to the line where logging is called. At that line data received from communication channel are simply dumped to the log on trace level (...
1
vote
1
answer
119
views
Monitoring file IO read and write events on Windows
I want to monitor access to some files on Windows.
What I need:
Watching ALL connected drives for READ or WRITE events on files (NOT the create/delete events), doing the filtering later
getting those ...