File handling refers to the set of tools, functions, and libraries to work with files and file handles. Creating, writing, appending, moving, and deleting files fall in this domain.

learn more… | top users | synonyms

0
votes
2answers
89 views

Way for java program to read file from when it was stopped

I am working on an application that reads a log file, looks for a specific string, sends alert emails and saves data from the file into a database. The reading functionality is working well, but I am ...
1
vote
3answers
135 views

How to make a random-access archive of text files?

I wrote an application that tests the performance of evolutionary algorithms. This application performs a run of the algorithm which consists of several generations. The data which is produced by my ...
1
vote
2answers
195 views

Retrying a statement or call in a catch block - code smell or anti-pattern?

I'm wondering how better to perform this operation for a large amount of files. The bit I'd like some thoughts on whether this copy/paste is acceptable enough of a tradeoff. try to write a file if ...
5
votes
1answer
143 views

Is there a standard way of cleaning data files?

Having spent quite a lot of time working in software companies that deal in medium to large data sets, I've seen that a choke point in their processes is often prepping data files for loading into ...
-2
votes
4answers
111 views

How often should saving to disk occur in an automatically saving text editor? [closed]

I am developing a simple text editor and would like the application to save the text automatically. In other words, the user would never have to press a save button. I have seen other applications ...
3
votes
1answer
71 views

What does it mean that file IO binary flag is only relevant on Windows

I was reading a question and one of the comments mentioned that "The binary flag is only relevant on Windows". Given the context of the question and answer, I interpret this statement as on ...
0
votes
2answers
222 views

Large MySQL Batch Inserts From PHP: Run insert from script, or save as SQL file?

We have a large dataset that's current residing in many, many spreadsheets. I've been tasked with getting part of that data into our MySQL DB. When all is said and done, I will probably be inserting ...
1
vote
1answer
115 views

How to name filename parameter to make clear it should contain full path? [closed]

I'm seeking vital naming of string filename parameter in parameter list used in various methods where filename with full path is expected. In many cases also UNC path can be actually supplied as full ...
5
votes
1answer
174 views

Why is Java 7's new file API usage still so scarce? [closed]

I don't even know whether this is the correct StackExchange site to ask such a question but here it is... I principally lurk on StackOverflow; and I am frankly flabbergasted by the number of ...
0
votes
3answers
82 views

Write to stdout and redirect or write directly to file?

I can see two ways to fill an empty file with data: $ run_program arg1 > data_file or, specifically write code that manages a file and write to it? ie. a file stream? Which is better to ...
0
votes
3answers
147 views

How can I handle this string concatenation in C in a reusable way

I've been writing a small C application that operates on files, and I've found that I have been copy+pasting this code around my functions: char fullpath[PATH_MAX]; fullpath[0] = '\0'; ...
0
votes
2answers
95 views

Whats a good structure to save and retrieve locations of images?

I got a java-ee application, where I collect informations about movies. Im my backend I provide data like the name, description, genre and a random uuid. I also got lots of related files, which are ...
0
votes
3answers
131 views

Advantage of monitoring file change using Windows API rather than manually

I developed a Windows software about an year ago. Part of it was to monitor few configuration files for manual changes by user and if any of these change restart a particular service. So, I used the ...
3
votes
2answers
152 views

What is a stream, and how does it work?

Like a data stream in general, this can be an I/O stream or memory stream or a file stream or what not. I understand that it's some sort of stream of bytes, that you can read to parse very large ...
0
votes
1answer
48 views

Uploading files(code) on a web server?

I have a very small and basic web site on a web server. Usually I'm doing the changes on a localhost where the development version is, and after that I upload it to the server with FileZilla. That's ...
0
votes
3answers
94 views

Advice on which storage technology for an Image repository [duplicate]

At this point, I'm not much of a programmer, solid html/css, familiar with JS but not a programmer by any means. I'm looking to pick up whatever is necessary for an upcoming project. I need to build ...
2
votes
1answer
86 views

How to share a file over multiple projects

I'm using Visual Studio 2010 to amend a C# project. Part of the application requires the user to be able to save and read a settings file (1 Project reads them in (as read only) from a file. The ...
1
vote
1answer
220 views

Editing files without race conditions?

I have a CSV file that needs to be edited by multiple processes at the same time. My question is, how can I do this without introducing race conditions? It's easy to write to the end of the file ...
4
votes
4answers
479 views

Test Driven Development: A good/accepted way to test file system operations?

I am working on a project at the moment that generates a table (among other things) based on the contents of a file-system, and and in turn does some meta-data modifications on the things it finds. ...
0
votes
3answers
136 views

CSS File Editing for Teams? (how to avoid stepping on each others' feet?!)

I'm wondering if anyone has a good solution for when you're working as a team and there's a single file used throughout a project (like a styles.css file) and everyone needs to use it throughout the ...
13
votes
1answer
1k views

How do I test a file reader?

I am working on a project with a few file formats. Some formats are specified by .xsds, others by documentation on their respective websites, and some are custom in-house formats that have no ...
3
votes
2answers
415 views

How to simulate inner join on very large files in java (without running out of memory)

I am trying to simulate SQL joins using java and very large text files (INNER, RIGHT OUTER and LEFT OUTER). The files have already been sorted using an external sort routine. The issue I have is I am ...
0
votes
2answers
4k views

How to update an existing excel file using java program? [closed]

I've made a file browser in java that opens and read already been made excel files. (using Apache poi 3.9 library) program read those files perfectly but i want to update some of those files. how can ...
1
vote
2answers
342 views

Ruby: Multithreading a CSV with output

I have a script written in Ruby that has maxed out a core in my server's Xeon processor for the last 2 hours. Since it's currently only using 1 of four possible cores, I want to try and rewrite the ...
0
votes
1answer
281 views

Reading a specific type of input from file

I have a software that reads from a file. Each object in the software takes 7 inputs viz. string string string float string float int I have an input file. It contains a number of input values. If ...
6
votes
5answers
365 views

How are new file formats constructed?

I've used a software suite that is installed in offices and on remote vessels. The installations communicate back and forth, and they do that by using a simple proprietary file format that looks ...
1
vote
3answers
317 views

Maintaining log stream after file name change

I'm trying to log to a file and move it about every 30 seconds. I'm using the os.rename function (which I do from a supervisord process) in python to move the current log to a timestamped log (which ...
-3
votes
1answer
367 views

Openning an Excel File (Like it opens in MS office when double clicked) but using java

some buddy told me there is nothing impossible in programming but i dont know about this one... :) well i want to open an .xlsx file and make it appear on screen normal in MS office, but the problem ...
5
votes
3answers
331 views

Where to load and store settings from a file?

I think this question should apply to most programs that load settings from a file. My question is from a programming point of view, and it is really how to deal with the loading of settings from a ...
4
votes
5answers
368 views

Should I encrypt files saved by my program

I'm trying to decide on what format I should save data in, and hopefully this question will help me come to a decision. The program I'm writing uses 'databases' in which word=meaning (not a ...
2
votes
2answers
532 views

Optimize Reading of Multiple files

I have a unique problem which I'm hoping someone can assist with. I have One big text file, our Production file. The data in the file is delimited in the following format Reference|Cost ...
0
votes
1answer
834 views

How to design an application that read files using MVC pattern?

I am going to write an application that reads data from a csv file, and display that data to the user. I intend to apply an MVC design pattern to create this application. A user will interact with ...
9
votes
4answers
2k views

What's the best practice for naming uploaded images?

Suppose I have a form in my web application where users can upload a profile picture. I've got few requirements about file size, dimensions etc, but when the user uploads the image, how should I name ...
4
votes
1answer
454 views

Designing status management for a file processing module

The background One of the functionality of a product that I am currently working on is to process a set of compressed files ( containing XML files ) that will be made available at a fixed location ...
3
votes
3answers
207 views

Storing lots of large strings with frequent “appends” and few reads

In my current project, I need to store a very long ASCII string to each instance of a given object. This string will receive an 2 appends per minute and will not be retrieved so frequently. The ...
1
vote
1answer
100 views

Efficient way to check for changes to the contents of folders

I am creating an application that maintains a database of files of a certain type in a given folder (and all subfolders) Initially the program will recurse the folders and add any file it finds of ...
1
vote
2answers
194 views

Quickly compute added and removed lines

I'm trying to compare two text files. I want to compute how many lines were added and removed. Basically what git diff --stat is doing. Bonus points for not having to store the entire file contents in ...
3
votes
2answers
3k views

PHP file_put_contents File Locking

The Senario: You have a file with a string (average sentence worth) on each line. For arguments sake lets say this file is 1Mb in size (thousands of lines). You have a script that reads the file, ...
2
votes
2answers
113 views

Criteria for selecting timeout value?

Situation: a piece of software reads frames of data from a file in a seperate thread and puts it on a queue, emptied by another thread. That second thread periodically checks on the queue and fails ...
3
votes
1answer
118 views

What does “windowed streaming” stand for?

So I was asking around the Mercurial development mailing list about binary diffing and patch handling and I got the following examples: whole file approaches (classic diff, bsdiff, Mercurial's ...
0
votes
1answer
2k views

How are Java ByteBuffer's limit and position variable's updated?

There are two scenarios: writing and reading Writing: Whenever I write something to the ByteBuffer by calling its put(byte[]) method the position variable is incremented as: current position + size of ...
1
vote
1answer
244 views

hash with file instead of array

Is it possible to use hash function but with File instead of Array, and it's gonna be saving the record in a file position and then search will fseek to that position, but I'm not sure how to open a ...
53
votes
12answers
31k views

Is it a bad practice to store large files (10 MB) in a database? [closed]

I am currently creating a web application that allows users to store and share files, 1 MB - 10 MB in size. It seems to me that storing the files in a database will significantly slow down ...
1
vote
2answers
97 views

How to handle file access transactions properly?

I'm looking for good practices or any advice regarding file access transaction mechanisms. We will have multiple instances of an application spread over a redundant network (cloud) watching a ...
2
votes
1answer
91 views

File Processing Times

I have a very simple program in Ruby that opens a dictionary file, sorted-words.txt and prints out all the words in pig-latin. I tested its speed, and the first time I ran it, the program finished in ...
2
votes
4answers
252 views

Where can I learn about how programs handle file systems like NTFS?

I'm writing a program to handle the xbox 360's STFS files. I'm encountering all sorts of problems about how to keep track of used vs unused blocks, reading non-sequential files, etc. These aren't so ...
0
votes
1answer
216 views

How to synchronize web page refresh with file upload from windows application?

I have a rather simple app in .net which uploads images in fixed intervals in an ftp server. The file name is specific. I need to have a web page that refreshes but i want this to happen only when ...
3
votes
3answers
464 views

Was API hooking done as needed for Stuxnet to work? I don't think so

Caveat: I am a political science student and I have tried my level best to understand the technicalities; if I still sound naive please overlook that. In the Symantec report on Stuxnet, the authors ...
0
votes
1answer
129 views

“t-sql” tool for csv files? [closed]

Is there a tool that allows to query files based on the following criteria, and change them? creation date filenames (e.g. filetypeA_YYYYMMDD_data2.blah) file content For the example, the workflow ...
11
votes
7answers
1k views

Is it necessary to read every single byte to check if a copied file is identical to the original?

I recently learned of a program called Total Commander. It's a Windows Explorer replacement and has its own stuff to copy files. To check whether the files are identical, instead of calculation a CRC, ...