ReadFile() is a Windows API function to read data from the specified file or input/output (I/O) device. Reads occur at the position specified by the file pointer if supported by the device.
Questions tagged [readfile]
2383 questions
0
votes
1 answer
File display using PHP and header() not working
I'm trying to show any file in the browser using PHP and headers, but it isn't working with a PNG image, it shows a strange black square like this:
The Strange Blank Square
Here is my code:

Alex'Presso
- 21
- 8
0
votes
2 answers
CSV file gives error on reading with open() in python 2.7
import unicodecsv
engagement_file=r'G:\college\udacity\intro to data analitics\datasets\daily_engagement.csv'
enrollment_file=r'G:\college\udacity\intro to data analitics\datasets\enrollments.csv'
project_submissions_file=r'G:\college\udacity\intro…

shivam sharma
- 35
- 6
0
votes
1 answer
ReadFile on volume fails with ERROR_INVALID_PARAMETER after FSCTL_ALLOW_EXTENDED_DASD_IO
I'm reading a volume (logical drive) with ReadFile. I'm using DeviceIoControl with FSCTL_ALLOW_EXTENDED_DASD_IO code, because I want to have access to all (including the last) bytes and had an issue trying to read last 512 bytes (ReadFile successed,…

Aleksei Alefirov
- 331
- 3
- 8
0
votes
0 answers
Bash Script Loop Out of Memory on Reading File?
This from a bash script, looks like it will always run out of memory eventually.. incrementally using more memory for each line it reads:
while read line; do
echo $line
done < ./hugefile
Is there a route to bash reading a file line by line, that…

David Brown
- 29
- 4
0
votes
0 answers
node readFile wont fire callback
So I am trying read a PDF file and send its buffer as an attachment to an email. The strange thing is I have never had the problem with fs.readFile before, the callback just never fires. I have tried checking the pdf if I can open it, if anything is…

Sizzlor ox
- 13
- 3
0
votes
1 answer
While reading .prn file using fs.open getting error TypeError: flags must be an int
var fileBuffer = fs.open('http://www.mysite/orderworkflow/barcodefiles/fragile.prn', function (err,data) {
if (err)
{
return console.log(err);
}
console.log(data);
});
var jobFromBuffer = printer.printBuffer(fileBuffer, options);
var jobFromFile…

Nilesh Pawar
- 655
- 7
- 12
0
votes
4 answers
avoid same data when reading from a file
strStr = ["192.168.42.12", "192.168.42.2"]
with open(datausage) as f:
lines = f.readlines()
for line in lines:
for ii in strStr:
if ii in line:
result = line
ip = line[5:-50]
…

praveen
- 91
- 11
0
votes
1 answer
Old version of file downloaded using PHP readfile
I have a PHP script to download a KML file from a file server. The download part works, but the file downloaded is an older version of the file stored on the file server.
I tried setting Cache-Control and Pragma headers, but still the older version…

Rynardt
- 5,547
- 7
- 31
- 43
0
votes
0 answers
read complex python file with multiple types of information
I want to read a quite complex file with python, where several blocks of data are to be analysed. The file looks somehow like that:
.dataset 'hello'
.param
param1 123
param2 456
.data bin
text1
text2
ndata 256

Robert
- 652
- 2
- 11
- 23
0
votes
2 answers
UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 1010494: character maps to
please I need help with this:
url ='https://www.sec.gov/Archives/edgar/data/1437750/0001477932-13-004416.txt'
with open('file', 'wb') as f:
f.write(requests.get('%s' % url).content)
with open('file', 'r') as t:
words= t.read()
The…

user5282933
- 1
- 1
- 3
0
votes
1 answer
ifstream can't find locate file on second try
I have the code below. If I enter the file's name immediately, it finds the file without a problem, and I do not have do to anything. If I, however, types in a file it does not locate first, it will not find the file in the coming sequences, even if…

Filip
- 71
- 1
- 7
0
votes
3 answers
C# detect quotes in a text file
I try to detect quotes in a loaded text file but it is not working. I have tried with '"' and '\"' without success. Any suggestion? thanks
void read()
{
txt = File.ReadAllText("txt/txttst");
for(int i=0;i

cubecube
- 1
- 1
0
votes
1 answer
C# Read/Import a text file into a ListView
I need to read a text file into a ListView. I have already saved it to the file, but it doesn't seem that anyone has a good answer for reading the file back in. When the file reads in; all the data is in the first column and not in displayed under…

NMeneses
- 152
- 6
- 20
0
votes
0 answers
python - sum a matrix and a small vector efficiently
I am currently working on a project and I would like to have some ideas on how to optimize my python script. I can't really give you the explicit code because I don't have it for now, but I am interested in any suggestion you might have.
So the idea…

Dany Am
- 1
0
votes
0 answers
Reading a file in assembly, program works but still prints error message
I am trying to read a text file and print the contents in assembly. The file is read and the contents do print out. However, "read file" is printed on the next line after the file's contents. I wanted to know why the errfor is being printed if the…

ajstc
- 39
- 1
- 7