Questions tagged [file-io]

File I/O is input/output that involves the file system. This could include performing operations on directories and files, such as creation and deletion, reading files, and writing output to files.

For an introduction on File I/O in C, see C Programming / File I/O on Wikibooks.

21104 questions
8
votes
3 answers

How to access and download a file from a server using HTML 5

I am currently working on a website that users can download binary media files from (mainly .mp3). We need a way for a "Download" button to save the file to the user's specified location in their browser's preferences, and it needs to somehow…
trevorhinesley
  • 845
  • 1
  • 10
  • 36
8
votes
4 answers

ColdFusion handling of HTML5

I am trying to implement an HTML5 input field that lets the user select multiple files to upload. I have the following in my form:
Michael
  • 2,546
  • 2
  • 20
  • 26
8
votes
1 answer

Is there fmemopen() in MinGW

I'm trying to compile some code that uses the fmemopen function in MinGW. I found out that this function is not available MinGW. I need a function equivalent to fmemopen(). Are there any alternative functions that I can use?
virus
  • 146
  • 1
  • 9
8
votes
4 answers

C: Too many open files using opendir and open

I am reading about 6000 text-files into memory with the following code in a loop: void readDocs(const char *dir, char **array){ DIR *dp = opendir(dir);; struct dirent *ep; struct stat st; static uint count = 0; if (dp != NULL){ while (ep =…
Callahan
  • 474
  • 1
  • 9
  • 22
8
votes
4 answers

Modify Clojure source code file in clojure

I was wondering if it's possible to load the code contained in a Clojure .clj source file as a list, without compiling it. If I can load a .clj file as a list, I can modify that list and pretty print it back into the same file which can then be…
sneilan
  • 1,367
  • 1
  • 10
  • 15
8
votes
5 answers

System.IO.DirectoryNotFoundException by File.Move

Just a quick question (I hope): When I use File.Move it gives me an error: System.IO.DirectoryNotFoundException was unhandled by user code Message=Could not find a part of the path. Source=mscorlib StackTrace: at…
Joshua Walsh
  • 1,915
  • 5
  • 25
  • 50
8
votes
3 answers

How to save a vector of keypoints using openCV

I was wondering if it was possible to save out a vector of cv::KeyPoints using the CvFileStorage class or the cv::FileStorage class. Also is it the same process to read it back in? Thanks.
Seb
  • 3,414
  • 10
  • 73
  • 106
8
votes
4 answers

How can you read a file line by line in JavaScript?

I'm writing a web-app for the iPad that will be loading data from a text file. (A sample data set is around ~400 kb). I have everything set up except the file reading. The way I have set up my code, you pass an object which reads a file line by…
Ryan Amos
  • 5,422
  • 4
  • 36
  • 56
8
votes
4 answers

mmap slower than getline?

I face the challenge of reading/writing files (in Gigs) line by line. Reading many forum entries and sites (including a bunch of SO's), mmap was suggested as the fastest option to read/write files. However, when I implement my code with both…
Ian
  • 3,500
  • 1
  • 24
  • 25
8
votes
3 answers

How to WriteFile to a PhysicalDrive (Windows 7) without getting ERROR_ACCESS_DENIED?

I'm trying to write a test pattern to every sector of a formatted USB drive. There is one logical drive (e.g. h:). This volume is FAT-formatted and contains data to be overwritten. Also, I want to overwrite the whole physical drive. The program is…
ur.
  • 2,890
  • 1
  • 18
  • 21
8
votes
3 answers

Cause of corrupted file contents

I'm having a recurring problem with an app in the wild. It has a fairly simple XML file it dumps out every now and then, something like every 30 minutes. The data files are often quite small - e.g. < 5KB. It doesn't hold a lock on the file - it…
John
  • 1,974
  • 2
  • 25
  • 32
8
votes
1 answer

Writing to a file from my WordPress plugin

I've written a custom plugin for my WordPress site that relies on reading/writing from an xml data file within the plugin folder. When I test this standard PHP code for file reading/writing, it will let me create/write to files located at the…
Yarin
  • 173,523
  • 149
  • 402
  • 512
8
votes
2 answers

Basic python file-io variables with enumerate

New to python and trying to learn the ropes of file i/o. I am working with pulling lines from a large (2 million line) file in this format: 56fr4 4543d 4343d 5irh3 Here is the function I'm using to return a code: def getCode(i): with…
some1
  • 2,447
  • 8
  • 26
  • 23
8
votes
5 answers

Reading data from a log file as a separate application is writing to it

I would like to monitor a log file that is being written to by an application. I want to process the file line by line as, or shortly after, it is written. I have not found a way of detecting that a file has been extended after reaching eof. The…
David Sykes
  • 48,469
  • 17
  • 71
  • 80
8
votes
3 answers

Android openFileOutput - no permission to create storage

I have a problem with permissions in my application. It looks like my app does not have permissions to create files on storage. String FILENAME = "hello_file"; String string = "hello world!"; FileOutputStream fos; try { fos =…
AlexS
  • 927
  • 4
  • 16
  • 29