2,388 questions
-1
votes
1
answer
75
views
How to block a windows ReadFile call
I have a requirement that a single ReadFile call on a specific NTFS file blocks until I explicitly permit it to proceed from another thread. I attempted to accomplish this by obtaining an exclusive ...
2
votes
1
answer
129
views
Why does ReadFile on stdin with size at least 64kiB hang under ssh?
Question
I'm trying to understand the following symptoms:
I have a C++ program that uses Windows
ReadFile
to read (and discard) all of stdin.
The ReadFile call specifies a read size of 0x10000 (...
1
vote
0
answers
61
views
php serve file to client
UPDATE – Solution –
<?php
include 'loggercode.php';
$filename = "pages-26-27.pdf";
header("Content-type: application/pdf");
header("Content-Length: "...
2
votes
1
answer
121
views
Overlapped Synchronous ReadFile call to read 1000 bytes of a 88 byte file does not trigger ERROR_HANDLE_EOF
The contents of a text file named existingfile.txt is as follows
The First Order Derivative of X2 is
2x. The derivative of sin is cos.
Math is the best
The code below is from a file named main.cpp ...
0
votes
2
answers
90
views
Reading mid part of file
I've been using vb6 to print a block of data from the middle of a file.
...
Dim Chunk As String * 100
Open files(i) For Binary As #ff1
MyLen = LOF(ff1)
Get #ff1, MyLen / 2, Chunk
For i = 1 To 100
f = ...
-1
votes
1
answer
107
views
How to read text file strictly as 256 character ASCII
I am trying to read a game data file from an old windows RPG in order to create an editor program. The code reads each character as its ASCII value. The files are in 256 character ASCII, but when I ...
0
votes
0
answers
45
views
Fuzzy searching of words in HTML file returning different results
My script reads various file types (TXT, CSV, JSON, DOCX, PDF, XLSX, HTML) and searches for specific words. It works fine for most file types, but for HTML files, it returns fewer results than ...
3
votes
0
answers
90
views
"Cannot access file" in ES module, that I could with CommonJS module (Electron JS app)
I'm building a desktop app using ElectronJS, which reads content of pre-existing XLSX files. I first created the app as a CommonJS module. Here's the minimal reproducible example code:
const path = ...
-1
votes
1
answer
94
views
Read data from Teensy 4.1 memory chip W25N01GV
Please help with the code.
Reading a file from flash memory. The file contains only 4 numbers in two lines: 254 128 and 0 127. The program must also read these 4 numbers: 254 128 0 127
This is what ...
0
votes
0
answers
36
views
No Output When Reading and Printing UTF-16LE File with Windows API
I have encountered an issue with Windows API I/O output that has been troubling me for several days. I want to perform a file read operation using the CreateFile function in the Windows API, reading ...
0
votes
0
answers
77
views
PHP readfile() problem on download content (I read all related posts before send it) [duplicate]
I'm having trouble creating a secure download on my site. It's not uploaded yet, and it's currently being tested on the XAMPP server on my PC. It should be noted that my operating system is Windows 11....
0
votes
1
answer
142
views
How to read a file with CreateFile in C++?
I can read a file with Unicode path like this:
#include "iostream"
#include "windows.h"
using namespace std;
///--- variables ---///
//-- DWORD --//
DWORD dwBytesToRead = 0;
//-- ...
-3
votes
1
answer
116
views
How do I read user input line by line as if it were a file?
I am new to C#. I want to be able to scan a user input line by line in C# (like you can in Java with a scanner or in Go with bufio).
My code needs to handle user input like this:
3
Hans
Grethe
Otto
...
4
votes
0
answers
98
views
read_delim() in R fails to read a pipe "|" separated file vs read.table()
I´m unsuccessfuly trying to read a txt file separated with pipes "|" using readr::read_delim() function, it especificly fails reading the row number 77410 and add a missing value (NA) in a ...
0
votes
0
answers
67
views
How to read a file from url with Node.js and Electron
How can I read a file with nodejs, even json, from url?
My file is on a server. I tried with ftp download but it is very inefficient.
Now is working on this, but is very slow for download and running.....
0
votes
0
answers
28
views
Using uploaded data across JavaScript Modules [duplicate]
I am working on a project that simulates generic sports matches. I am trying to add functionality where a user can upload/save teams to the project. To organize the scripts, I have separated various ...
0
votes
2
answers
318
views
Coupling Reservoir Simulation with Python Script
I have been trying to couple my Python script with CMG reservoir simulation software for the oil and gas industry. The software generates an output file for each timestep (e.g. 0.1 day, 0.2 days etc). ...
0
votes
0
answers
40
views
Python creating file outside of Working Directory [duplicate]
As the title describes, I am not sure why, but the same code was working fine before I tested on reading/writing a file outside of the directory. I was testing on the desktop folder and got it to read ...
1
vote
0
answers
99
views
TypeError: readFile is not a function at PDFLoader.load (langchain) with Jest typescript
i am trying to make a test with Jest in typescript, and i'm running in an error that i can't seem to find the fix to.
I have an express.js backend that has a route '/upload'. The route takes a file ...
2
votes
0
answers
84
views
How to read a doc file using python and read the text line by line?
how to read a doc file in Python? some libraries showing errors while reading the file. sometimes we need to convert the doc file into docx at first and then use some library that supports this ...
0
votes
1
answer
729
views
SQL query to read file name and content from physical location
I need SQL query or function/procedure, that can read all file names and content from physical location and insert into the SQL table. There are two things here-
All the files are text file (.txt)
...
1
vote
2
answers
197
views
Drawing function, according to the instructions from a text file
I have implemented a small program, that has one function to open and read a text file with instructions for drawing, whereas the second one is targeted at drawing. The second one was already utilised,...
1
vote
1
answer
142
views
Opentextfile after file exists
Similar to VBScript OpenTextFile Invalid Proedure call or argument
I'm trying to access a file which seemingly exists, but gives me an error 5.
Here is my code:
`Strfilepath="...\query.txt"
...
0
votes
1
answer
95
views
Receive file contents in React front-end application
I am having an API endpoint in my NodeJS application. I am posting a filename to it to find the specific file in a folder. I am doing it like this:
const fileDirectory = 'C:/Sites/private-uploads';
...
1
vote
1
answer
2k
views
Steamlined way of reading a file with zig
I have a file with a bunch of primes. For this purpose we can say that the contents of this file called "primes" are as follows:
2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,...
0
votes
1
answer
127
views
Error: expected str, bytes or os.PathLike object, not StorageStreamDownloader - Decrypting a blob file using pgp in python
I am trying to read a csv file (encrypted) from azure blob storage and decrypt it using gnupg and read it in python. I am able to access the blob file but when I pass it to dcrypt function it throws ...
0
votes
2
answers
168
views
ReadFile function from WinApi does not read from CreateProcess with CreatePipe
I'm writing an application to obtain Geolocation on C.
To get the coordinates, I decided to use Popen with PowerShell and this is the code I wrote:
BOOL getLatitude(wchar_t* latitudeBuffer)
{
...
0
votes
1
answer
164
views
Android c++ AAsset_read reads wrong data
I read content of text files from assets. However, if I read second file then I get wrong result. It is mixed with previous file.
Here is first file, this is correctly written to buffer by AAsset_read:...
1
vote
1
answer
318
views
Using Pipes for Input / Output for CreateProcess; ReadFile blocks Program
I want to write a program that executes a cmd or powershell command.
To achive this I create a process with CreateProcessA and use pipes for Input / Output.
My code works fine but after the command (...
2
votes
0
answers
824
views
How can I read file in Next js server api?
I'm using nextjs 14 and making a function to create events in Google Calendar. I need to authenticate.
The problem occurs when I try to read the contents of the credentials.json file.
This works in ...
4
votes
4
answers
232
views
how to read a file and save content in a string? (in C language without crash or core dump error)
I wrote a code to read a file. Read the default file or another file and store the content file in a string. I don't know where I went wrong! When I run it, sometimes it's ok, but sometimes I get a ...
0
votes
0
answers
309
views
How to read SAS7BDAT file from S3
I have a file.SAS7bDAT file in AWS S3 bucket. I need to read this file into a dataframe directly using boto3 client for further processing.
How can I read it in a dataframe using boto3 S3 client?
...
1
vote
1
answer
433
views
Trying to read files in /resources in karate and getting: could not find or read file
Read this: https://github.com/karatelabs/karate#reading-files
It says how to set pom.xml for restricting classpath to not read /resources. Can i know what should be the pom.xml for classpath to read ...
0
votes
2
answers
1k
views
Problem reading file using SMBLibrary with SMB2
I'm trying to read a file from an SMB server using .net7 api and SMBLibrary, but the read fail with null data and the status :"STATUS_END_OF_FILE".
I want to get the stream data to upload it ...
0
votes
0
answers
33
views
windows vc++ - EOF when reading a volume before the end of the volume
I'm trying to read a partition block by block using vc++. The hard drive has a block size of 512 bytes and the partition table tells me that the partition has a start offset of 128 and an end offset ...
0
votes
1
answer
28
views
Reading an input file and the output is not as I expected
My file contains "abcdefg".
Why when I use this part of code, in console, it prints letter 'g'?
#include <iostream>
#include <fstream>
#include <cstring>
using namespace ...
-1
votes
1
answer
86
views
problem with open a .xlxs file, someone else is using it
i have a problem when i try to open a file .xlxs in a public disk P: with VBA Code. The file show me a message "please try again later - ERROR 1004". Many user use this file and this error ...
-1
votes
2
answers
99
views
PHP echo() corrupting readfile() output
I have this PHP script (process.php):
<?php
// Include necessary libraries for database, PDF generation, and ZIP compression.
require_once('db_connection.php');
require_once('tcpdf/tcpdf.php');
...
0
votes
1
answer
31
views
Display files without block the app in php
I'm serving a php app on Apache2. In a function I simply want to display media, using php script instead of hosting the medias in a public folder on the server.
This is because I want to be able to ...
-1
votes
1
answer
998
views
TypeError: expected str, bytes or os.PathLike object, not method, trying to get an archive
Im currently trying to build and app to manage budgets or expenses,
im new to python and everything really,
so im getting help from a friend, and im not quite familiarized with all the processes ...
-4
votes
1
answer
68
views
Why does reading 10 50 MB files take the same amount of time as reading one 500 MB file in nodejs?
// fulfill one promise 5000ms
console.time('test');
(async function () {
await new Promise((resolve) => setTimeout(resolve, 5000));
console.log('slept')
})()
.then(() => {
console....
0
votes
0
answers
41
views
fscanf operation with empty (SQL NULL) values
I'm reading a tab delimited csv file with fscanf.
The file was obtained from an SQL database where some columns were NULL. Accordingly, there are places where there is nothing in csv between tabs, and ...
0
votes
0
answers
39
views
php readfile does not download
I am testing a small bit of code to download a file but nothing downloads. I have looked at countless examples (I know this has been asked many times) and from reading these examples this should work. ...
0
votes
3
answers
98
views
How to write a file and then delete it
I am a C# programmer and need to go for python now. It is my 2nd day so far.
I need to write a file, read it and then delete it.
In C# that's easy peasy.
string strPath = @"C:\temp\test.txt";...
0
votes
3
answers
4k
views
How to read a file using showOpenFilePicker (NOT <input type="file">)
I want a cleaner UI than what
<input type="file" ...>
gives me.
I can use window.showOpenFilePicker() to get the user gesture security context and get a "fileSystemHandle" ...
0
votes
2
answers
61
views
How to read each line at once, save the information in that line and then move onto the next line in Java
I'm having this problem, I think it's basically just algorithm but I can't figure it out though I try multiple ways. I have a file name "employees.txt". Each line in this file is a record, ...
-3
votes
1
answer
97
views
How to solve problem when reading from a file in c++ [closed]
I'm trying to read the information from a .txt file but something very strange is happening.
Here's the code:
ifstream fichier(dir);
fichier.open(dir);
if (fichier.is_open())
cout << &...
1
vote
1
answer
980
views
C++ WInApi ReadFile reads nothing and reports error 109 ERROR_BROKEN_PIPE
I have been trying to call adb from a C++ app and read its output, without success. adb is present on PATH.
The ReadFile call never reads anything, even if I wait.
GetLastError() returns 109 ...
-1
votes
3
answers
81
views
regex - multiple line and multiple content
I'm looking for a pattern that match with
"changes": [
"5.12.0",
"5.14.0"
],
...
"changes": [
"1",
"5.0.0&...
2
votes
2
answers
78
views
How I can avoid multiple nested loops when I don't know the deep of the tags (deep intended as the children of the children) - python
I have whatever HTML file, this html file has many tags that have children, and those children have more children and the deep is unknown.
An example file is:
<!DOCTYPE html>
<html lang="...