Questions tagged [readfile]

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.

2383 questions
8
votes
3 answers

Android: how to get list of all preference xml's for my app and read them?

how to get list of all application preferences for application, 1. I am saving shared preference in this manner 2. I know that they are in data/data/app_packagename/shared_prefs 3. THE PROBLEM: But how to get list of all preference xml files in a…
8
votes
4 answers

Python - Read second column from file

My input file has two columns. I am trying to print the second column of inputdata1.txt within a second for-loop. But my code is not working. Can someone tell me what should I do?
user1251265
  • 89
  • 1
  • 1
  • 4
7
votes
3 answers

NodeJS readFile() retrieve filename

I am iterating over an array which contains filenames. For each of them, I invoke readFile(). When the corresponding callback is invoked, I wish to retrieve the filename passed to readFile() as a parameter. Can it be done? Enclosed a snipped code to…
MrIzik
  • 139
  • 1
  • 3
  • 8
7
votes
4 answers

Unable to parse as integer

Alright...I have this .txt file (UTF-8) 4661,SOMETHING,3858884120607,24,24.09 4659,SOMETHING1,3858884120621,24,15.95 4660,SOMETHING2,3858884120614,24,19.58 And this code FileInputStream fis = new FileInputStream(new…
svenkapudija
  • 5,128
  • 14
  • 68
  • 96
7
votes
1 answer

PHP readfile adds content length to output

I am using the PHP readfile function to read a file and print it like so: print readfile ('anyfile'). This works, but the content length of the file is added at the end of the string also. Why?
SQLighter
  • 592
  • 7
  • 12
7
votes
2 answers

Reading mp4 files with PHP

I'm trying to read mp4 file with PHP and what I'm doing now is this: but this way I can't skip or even go back until the video is not loaded 100%. Of course when I read directly…
user2221276
  • 103
  • 1
  • 1
  • 4
7
votes
4 answers

How to get directory of executable in Haskell?

I have a program that reads and writes a text file that exists in the same directory as the executable. To access that file, I call readFile "./file.txt" This works when I run the executable from within the directory where it lives. However if i…
Sam Stern
  • 24,624
  • 13
  • 93
  • 124
7
votes
2 answers

Read two textfile line by line simultaneously -java

I have 2 textfiles in two different languages and they are aligned line by line. I.e. the first line in the textfile1 should be equals to the first line in textfile2, and so on and so forth. Is there a way to read both file line-by-line…
alvas
  • 115,346
  • 109
  • 446
  • 738
7
votes
2 answers

How to parse a 7GB file, with Data.ByteString?

I have to parse a file, and indeed a have to read it first, here is my program : import qualified Data.ByteString.Char8 as B import System.Environment main = do args <- getArgs let path = args !! 0 content <- B.readFile path let…
Fopa Léon Constantin
  • 11,863
  • 8
  • 48
  • 82
6
votes
4 answers

Java reading txt.file - access denied?

I have created a txt file which I have saved in My Documents on my computer. I am trying to read the txt file through FileReader and BufferedReader. However, when I try to run the program I get the error message: java.io.FileNotFoundException:…
Kristian
  • 1,239
  • 12
  • 31
  • 44
6
votes
2 answers

Python Read huge file line per line and send it to multiprocessing or thread

I have been trying to get my code to work for many days, I am desperate. I've scoured the internet, but I still can't find it. I have a text file encoded in "latin-1" of 9GB -> 737 022 387 lines, each line contains a string. I would like to read…
Eva exe
  • 87
  • 6
6
votes
4 answers

PHP readfile returns zero length file

This is weird. I have a script which sends local zip files to the user via browser. The script has worked fine so far without any problems. Today my colleague notified me about the script is sending zero-length files. Some background info: Server…
fabrik
  • 14,094
  • 8
  • 55
  • 71
6
votes
1 answer

Swi Prolog, Read file examples

I am new to Prolog but I get the basics. I am having problems reading a file. Here is my file: 16 78 45 12 32 457 97 12 5 731 2 4 55 44 11 999 7 I want to read it so that I get back the characters as numbers. The first line is the amount of…
6
votes
1 answer

How do you read data from a text file in Swift 3 (XCode 8)

first I would like to start with my current situation: 1) Current Situation: I have a text file (data.rtf) I have also tried and am willing to use .plist or any other format to get a result. I have been trying to read ANY data from this file, and…
6
votes
5 answers

Should GC.Collect() be called regularly?

I recently posted an article about a log file reader failing due to out of memory errors > Out of memory error archiving a log file Before I had a chance to try the simpler methods (calling the log file a name with a date in to prevent archiving…
MonkeyMagix
  • 677
  • 2
  • 10
  • 30