I'm working on a program that takes a redirected file as input. For example, if my program was called foo I would call the program with ./foo < input.txt. The files I'm running through my program are supposed to be formatted with a single integer on the first line, two integers on the second line. So something like
3
1 8
I'm finding t...
Hey all,
I'm attempting to read a binary file and I keep getting errors on 64-bit systems where it appears that the file is being open with write privileges and thus throws an error when placed in a secure folder (Program Files in 64 bit Windows). I can duplicate this error on my system (XP, 32 bit) by setting the folder containing the...
I am attempting to download fairly large files (up to, possibly over 1GB) from a remote HTTP server through a PHP script. I am using fgets() to read the remote file line by line and write the file contents into a local file that is created through tempnam(). However, the downloads of very large files (several hundred MB) are failing. Is ...
Hello,
I'm writing a brute-force program for enumerating a certain kind of integer sequence (not important what this sequence actually is).
In order to get my results, I create a file and I'd like to write all program output to this file. However, it seems that the file "stagnates" at 524 kb even if the program should write something i...
I have to access a config file which is in a directory on the app server file system, but is not deployed as part of my J2EE app.
Would getResourceAsStream() help me in this case?
Thanks
...
I have some subroutines that I call like this myWrite($fileName, \@data). myWrite() opens the file and writes out the data in some way. I want to modify myWrite so that I can call it as above or with a filehandle as the first argument. (The main reason for this modification is to delegate the opening of the file to the calling script ...
I have two questions regarding Erlang file i/o; what is the best way to achieve in Erlang:
reading large binary files (many gigabytes) without copying the whole file into memory
reading a gzipped binary file as a decompressed stream
Thanks!
...
Okay, so this is the line that's returning null. What am I doing wrong while creating this FileInputStream?
FileInputStream fin = new FileInputStream(new File(getClass().getResource("data/levellocks.lv").toURI()));
...
All,
My code makes use of BufferedReader to read from a file [main.txt] and PrintWriter to write to a another temp [main.temp] file. I close both the streams and yet I was not able to call delete() method on the File object associated with [main.txt]. Only after calling System.gc() after closing both the stream was I able to delete the ...
I want to read in the contents of a file into a list. Some of my attempts so far have been -
(defun get-file (filename)
(let ((x (open filename)))
(when x
(loop for line = (read-line x nil)
while line do (list line)))
(close x)))
(defun get-file (filename)
(let ((x (open filename :if-does-not-exist nil)) (content...
Hello all!
I am new to python (and this site); I am trying to write a script that will use a regular expression to search through a given file to find a name. I have to print out the different ways the name was capitalized and how many times the name was found. My current code will just print out my first flag and then hang. I don't know...
On opening a directory via zwopenfile(open directory option), it returns a handle for the directory path. Now I need to get the directory path from the handle. Its my requirement.
I could see an example(please see the code below) where file name can be fetched from file handle. But the below example does not help for directory. Is ther...
I have defined a record which has lots of fields with different types (integer, real , string, ... plus dynamic arrays in terms of "array of ...").
I want to save it as a whole to a file and then be able to load it back to my program. I don't want to go through saving each field's value individually.
The file type (binary or ascii or .....
I have a file format (.STL, stereo lithography, the structure is standard and can not be changed. Not to be confused with standard template library) that uses a 50 byte data structure. Reading from the HD directly leads to wrong data being read as 50 bytes is not a multiple of 4.
Out of the entire 50 byte structure, I only need 36 of th...
Well guys I am in a bit of a pickle here...
I am doing some exercises on encrypting data. One of them are binary files. I am currently using triple DES to encrypt and decrypt the files both in VB.NET and C#...
Now the thing is, once it is decrypted in VB.NET and saved, i can execute it again...
But for some reason, my C# file is bigge...
Suppose I want to read an entire file in memory. I'd open it in binary mode, use fseek to get to the end of the file, then do ftell to get its size.
Then I would allocate a string with the same size as the file, and just read it in, right?
The problem is that ftell returns a long int, and malloc should receive a size_t argument. Now, si...
I never thought it would happen to me, but I ran into my first bug in Java:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5003595
I'm pretty much in the same exact situation as described in the bug (NFS on linux), and I'm seeing that File.exists() is not returning the correct value (at least not right away).
So my question is, is...
I'm debugging an old OPENSTEP (YellowBox) app, written in Objective-C, running on Windows 2000, built with Project Builder. The only easy way I can find to write a string to disk in Obj-C is [NSString writeToFile], a Cocoa/iOS-era method which doesn't seem to have been written yet in the version of OPENSTEP that I'm compiling against (us...
dseg segment
FileName db "hex.txt$"
dseg ends
cseg seg..
...
wrFile proc
push ax bx cx dx
mov ax,3D00h
mov dx, offset fileName
int 21h
mov bx,ax
mov cx,10*type scores
mov dx,offset highscoresnum
mov ah,40h
int 21h
mov dx,offset highscoresdate
mov ah,40h
int 21h
mov ah,3eh
int 21h
pop dx cx bx ax
ret
wrFile endp
at the f...
I tried to use the read/write file descriptor in bash so that I could delete the file that the file descriptor referred to afterward, as such:
F=$(mktemp)
exec 3<> "$F"
rm -f "$F"
echo "Hello world" >&3
cat <&3
but the cat command gives no output. I can achieve what I want if I use separate file descriptors for reading and writing:
...