I'm going to first admit that this is for a class project, since it will be pretty obvious. We are supposed to do reads to probe for the block size of the filesystem. My problem is that the time taken to do this appears to be linearly increasing, with no steps like I would expect.
I am timing the read like this:
double startTime = ge...
I have observed that sometimes in C programs, if we have a printf in code anywhere before a segmentation fault, it does not print. Why is it so?
...
I'm trying to store some data in a binary file:
import os, pickle
o = some_object()
file = open('test', 'wb') #this causes the error
pickle.dump(o, file)
file.close()
I get this error: IOError: invalid mode: wb
It doesn't work (neither on test server or GAE itself), apparantly because it does't have the write permission.
How can I ...
I want to create my own incremental backup solution using C#. How can I obtain the difference between two files (version 1 and version 2 of ABC.TXT) and then update ABC.TXT version 1 with the difference? Would appreciate some hints! Thank you!
...
What is an efficient way for a Java multithreaded application where many threads have to read the exact same file (> 1GB in size) and expose it as an input stream? I've noticed that if there are many threads (> 32), the system starts to contend over I/O and has a lot of I/O waits.
I've considered loading the file into a byte array that...
(I looked everywhere for this, perhaps my googling skill is off today)
I have a program that requires a handful of initialization cmds from stdin (and not through arguments). It'd be nice to move those commands into a script so when the script completes I can start keying the real work. So something like:
cat initcmds.txt | myprogram.e...
I have an Java application for copying large amounts of data from users' workstations to a server. The java.io.File class is supposed to work with UNC paths very well and in fact it does but only when I run the app in standard execution model.
When the application is launched via Web Start I get a FileNotFoundException when trying to op...
Hello all.
I am currently attempting to read in Hex values from a text file.
There can be multiple lines of Hex's and each line can be as long as needed:
f53d6d0568c7c7ce
1307a7a1c84058
b41af04b24f3eb83ce
Currently, I put together a simple loop to read in the Hex values into an unsigned char line[500] with fscanf as such:
...
hi all, when using files in the ruby language, what is the difference between r+ and w+ mode?
and a+?
great thanks.
...
I'm considering a set of 4 programs: (Prog1, Prog2, Prog3, Prog4)
interacting with 4 files (FileA, FileB, FileC, FileD)
Prog1: writes (appends) to FileA
Prog2: reads File A and writes (appends) to FileB
Prog3: reads File A, and writes (appends) to FileC
Prog4: reads File B, and writes (appends) to FileD
or Potentially Prog1, might al...
Hi.
I have a xml file that I would like to update after it has already data.
I thought about open the xml file in "a" (append) mode. The problem is that the new data will start to be dumped after the "root" tag has been closed.
What I wanted someone to be kind enough to tell me is how can I delete the last line of a file, and then sta...
I am trying to add iostream to the legacy code and thus want to sync those two libraries.
According to this article, I should use std::ios_base::sync_with_stdio.
Now, I wonder how it is used in practice (examples please), side-effects I should be aware of.
Thx
...
How can I achieve the best file streaming performance in Vista? My goal is to read a large file (several hundred MB) over the network directly into memory.
I've allocated a memory block the same size as the file. This is also my destination buffer. I've tried ReadFile, _read, fread, ifstream::read, and boost::iostreams::mapped_file::con...
We have a rather large and complex application written in Java which is running on top of the Gridgain package. The problem I am having is that this application will sit there processing requests for approximately a day before every request starts resulting in an exception of type java.nio.channels.ClosedByInterruptException.
My suppos...
Hi,
In .Net, When I fetch a resource from a resx in an external resources assembly - does this involve a fetch from Disk or Memory?
Thanks
...
How can I create a file in python one directory up, without using the full path?
I would like a way that worked both for windows and linux.
Thanks.
...
Is it possible to ObjectOutputStream/ObjectInputStream an internal class? I can write it OK, and examine the created file, but when I try to read it back in using ObjectInputStream, I get an EOFException just trying to read an Object o = oos.readObject();
I use the same File object to open both streams, so that's not the problem.
It s...
I am trying to read from file:
The file is multiline and basically i need to go over each "word". Word being anything non space.
Sample input file would be:
Sample file:
test 2d
word 3.5
input
{
test 13.5 12.3
another {
testing 145.4
}
}
So I tried something like ...
I am trying to delete 10000+ files at once, atomically e.g. either all need to be deleted at once, or all need to stay in place.
Of course, the obvious answer is to move all the files into a temporary directory, and delete it recursively on success, but that doubles the amount of I/O required.
Compression doesn't work, because 1) I don...
How do I do on-the-fly search & replace in a Java Stream (input or output)?
I don't want to load the stream into memory or to a file.
I just see the bytes passing by and I need to do some replacements. The sequences being replaced are short (up to 20 bytes).
...