Questions tagged [file-handling]

file-handling is an abstraction of common actions such as creating, opening, closing, reading, updating, writing, comparing and deleting files

2915 questions
4
votes
2 answers

Cannot write the data in the file, no error in the program C++

I cannot write data on a file with these pointer variables in the class. there is no error in the program but no data is written on the file. kindly someone tell me that where i am doing something wrong. #include #include…
Sireiz
  • 383
  • 3
  • 10
4
votes
2 answers

reading big data in C++

Im using C++ to read large files with over 30000 lines and 3000 colums. (30000 x 3000) matrix. im using a 2d vector to push the read data. But i need to do this process a couple of times. Is there any way to optimize the reading process?
Abhishek Thakur
  • 16,337
  • 15
  • 66
  • 97
4
votes
4 answers

Java URLClassLoader not recognising a String

I've got a really strange problem. I'm using a URLClassLoader to dynamically import files from a directory. The code works fine if I use a literal string, and works fine if I use a variable to a literal string, but this isn't what I need. package…
Apache
  • 619
  • 6
  • 22
4
votes
1 answer

Parsing a flat file in Java

I have a flat file in which data is stored in position based format For eg. from 1 to 5 - some x value is stored, from 6 to 13 - some y value is stored, from 14 to 18 - some z value is stored and so on.. I need to parse the file and get those values…
Anand
  • 20,708
  • 48
  • 131
  • 198
4
votes
2 answers

Handle ASCII in R

I have some files of Micro Data from a Populational Census stored as .txt and coded in ASCII. When I open them in a text editor I get something like: 1100015110001500100100003624008705865085282310200600101011022022 14 444231 etc. Since I have no…
Joschi
  • 2,941
  • 9
  • 28
  • 36
4
votes
3 answers

finding out the downloaded image file size in IOS

Hello I would like to run a thread and check the current downloaded size of a file. This is what I use UIImage *image = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL…
Sarp Kaya
  • 3,686
  • 21
  • 64
  • 103
4
votes
2 answers

Storing String on File in C

I created a small program to input some records to a file. #include int main(void) { FILE *fp; //opening a file to write fp = fopen("try.rec","w"); if(fp == NULL) { printf("\nSorry! Couldn't Create File"); …
cipher
  • 2,414
  • 4
  • 30
  • 54
4
votes
3 answers

How to delete root app/app/ files?

My phone is rooted. I'm trying to do a very simple program. The program should delete file from app/app folder. How can I do this? I'm newbie, so example code is valued.
eagerToLearn
  • 41
  • 1
  • 3
4
votes
1 answer

Why does calling istream::tellg() affect the behavior of my program?

I am trying to convert a 24 bit bitmap image into grayscale. #include #include #include #include using namespace std; class pixel{ public: unsigned char b; …
Diptanshu
  • 103
  • 2
  • 6
4
votes
3 answers

Simple Delete File Program in ANSI C for Windows

Looking for a simple program to a delete a file written in ANSI C. Just as an example how would you delete a file at "C:\test.txt" with C?
BuddyJoe
  • 69,735
  • 114
  • 291
  • 466
3
votes
2 answers

File handling in JavaScript

Is it possible in javaScript to create an html file in same directory ? After some searching on google I landed upon using ActiveXObject like this :- var fso = new ActiveXObject("Scripting.FileSystemObject"); varFileObject =…
Lina Clark
  • 243
  • 4
  • 9
3
votes
1 answer

Sharing data between applications - share memory vs D-Bus vs File operation

Consider a scenario in which two applications have to share data among them. I can think of three ways- Shared memory ( Boost I am allowed to use ) D-Bus ( glib / Qt implementation allowed ) File operations on a common file between the two…
Amit Tomar
  • 4,800
  • 6
  • 50
  • 83
3
votes
4 answers

how to read line by line in android?

i am using this code. try{ // Open the file that is the first // command line parameter FileInputStream fstream = new FileInputStream("config.txt"); // Get the object of DataInputStream …
rameezmeans
  • 830
  • 1
  • 10
  • 21
3
votes
1 answer

How to handle ofstream object in case of application crash

I've a singleton logger class which will be used to write data into a single file and I'm just wondering how to handle the ofstream object in case of application crash. #ifndef LOG_ERROR_H_ #define LOG_ERROR_H_ #include #include…
m_alpha
  • 134
  • 13
3
votes
1 answer

Why is StandardOpenOption.CREATE_NEW not creating a file to be read from in Java?

Here is my code: import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.SeekableByteChannel; import java.nio.file.Files; import java.nio.file.InvalidPathException; import java.nio.file.Path; import…
Shri
  • 109
  • 9