Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [file-handling]

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.

0
votes
1answer
52 views

Solutions for managing large image libraries with tags [closed]

So my issue is managing collections of tens of thousands of pictures efficiently. The main pain points are to efficiently be able to tag each one and then search the library. At first I tried to use ...
0
votes
1answer
114 views

How should I separate File Parse Classes?

I want to understand different ways to object design classes. I have three different classes. Generally I am creating a file parser. The classes: CustomerData - which shows text Data Model. A File ...
2
votes
0answers
53 views

How to write disk benchmarking software?

I am coding a disk (HDD/SSD) benchmarking software. I have a few questions on how a disk should be benchmarked (regardless of programming language used). This is my pseudo code for testing sequential ...
0
votes
3answers
139 views

How do I deal with file downloads?

I'm currently working on a script (in PHP, but I'm not sure if that's relevant here) which allows users to set up a simple file-sharing system on their server. I'm stuck when trying to figure out how ...
0
votes
1answer
47 views

Creating data files inside a package

I'd like to deploy my code to a web server as a package. There Python is subprocessed and scripts are executed. These scripts use data files. But in case a file is needed and it doesn't exist, it ...
0
votes
2answers
88 views

Class design : Decide between file and database for storage during runtime [closed]

Based on the demo or license version of my application, I am supposed to either save the data to a file (xml) at a specific location or a relational database. What should be my approach for this case ...
5
votes
2answers
334 views

How to deal with file events with microservice that exposes a REST API

A bit of context. The company where I work is starting to transition to a modular architecture (something similar to microservices) for our main product, currently monolithic. The first step is to ...
2
votes
0answers
242 views

File upload sync for offline desktop application. (Electron)

We are making an offline desktop application in Electron that needs to sync when the user goes online. Sqlite is used as the database when offline and it gets synced to postgres on the server when ...
0
votes
0answers
44 views

How to combine client, backed and object storage conceptually?

I want to understand concepts of adding an object storage server to a exiting application. Consider the following diagram. At the moment I have an Jetty RESTful server running -namely dropwizard- ...
1
vote
1answer
116 views

How to scale a file based process

I'm looking for a method to solve the following problem: Assume there is a spool directory with a lot of files that need to be processed. There is a process A that is constantly writing new files to ...
4
votes
2answers
287 views

What is constraining cross-platform asynchronous file I/O?

Looking at a range of cross-platform languages, libraries and GUI toolkits, I often notice a conspicuous absence of support for asynchronous file I/O. This seems like too much of a common factor to be ...
0
votes
1answer
675 views

An elegant way to detect the end of an asynchronous recursive file search?

Given a recursive subroutine in single threaded environment which starts numerous asynchronous I/O operations and registers callback functions for each of them. This callbacks will be called on the ...
-4
votes
2answers
108 views

Why aren't directories for files created automatically? [closed]

One of the most annoying boneheaded bugs I run into is trying to create a new file in a directory that does not exist. (At least on Windows/NTFS, not sure about other OS/FS combinations.) Here's how ...
-4
votes
1answer
129 views

Right Click SaveAs and Open C# Application [closed]

I am wanting to develop a C# application that would allow me to right click on a file and choose an option within the context menu to perform a save as with a date time stamp and then open the newly ...
1
vote
1answer
3k views

Storing images in base64 vs binary, in cloud

I'm developing a photo sharing website. Currently, the way I wrote it, a user uploads a photo (jpeg), which is read in as a Base64URL (using FileReader). The backend (Django) uploads this file to ...
9
votes
3answers
459 views

Writing at the start of a file something you only know at the end

Background: I'm writing micro controller C code to write an EBML file. EBML is like a binary XML with nested elements, but instead of start and end tags, there is a start ID, length, and then the data....
3
votes
2answers
252 views

REST API with files as resources?

I'm storing files as REST API resources, sending and receiving them as base64 strings, along with some other metadata. What's the best way to handle GET for the collection? (e.g GET .../api/files) ...
7
votes
1answer
10k views

Why would anyone use multipart/form-data for mixed data and file transfers?

I'm working in C# and doing some communication between 2 apps I'm writing. I have come to like the Web API and JSON. Now I am at the point where I am writing a routine to send a record between the two ...
6
votes
1answer
7k views

Base64 in Json: Is it a Good Idea for Rest API?

I am developing a Rest API, and I am asking myself: Is it a good Idea to put base64 encoded data in Json, e.g. for file uploads? What if the base64 contains some of {,},: characters and breaks the ...
3
votes
1answer
265 views

How is persistence-ignorance relevant to a file format–centered application?

I have a small side-project of about 3,000 sloc. I'm experimenting with building a DDD-like domain model into it, so I have more experience with this style for work. The project is centered around ...
0
votes
1answer
261 views

What's the best way to do horizontally scalable file uploads?

In general, how do websites handle file uploads when they scale horizontally? Obviously if you have a load balancer going to 10 application servers, and each application server just saves an upload ...
4
votes
2answers
100 views

Dealing with potential failures when appending data to a file on disk

I'm designing an application that will be appending blobs to a file on disk (local filesystem) and I'm currently thinking of how to deal with consistency issues that could occur if: The application ...
7
votes
4answers
3k views

Is it bad practice to read large file in constructor?

So, I am trying to create an English language trie data structure implementation in C++. I have created a Trie and TrieNode class. The TrieNode class takes in its constructor a vector<string> ...
1
vote
0answers
211 views

I want to write an application to compare files, similar to WinMerge. I'm not sure how to design it, though

My current project is to implement a kind of WinMerge clone to compare two files. I am using C++ with the Win32-API (WTL, ATL, that stuff), and I already designed an UI for this. However, I am now ...
3
votes
4answers
336 views

Would you use Byte Arrays or XML if size was not an issue?

In my basic understanding of ByteArrays the benefit is that it is smaller in file size. The down size of a ByteArray is that for any given format you have to know the about the file format to get ...
5
votes
2answers
13k views

Java - Processing a large file concurrently

So at a high level my use case is as follows - I periodically (every 24 hours) get a very large file (size can vary from MBs to 10s of GBs) which I need to process within 24 hours. The ...
-1
votes
1answer
210 views

How do you create a Composite file in C++

I am looking to create a "Composite file" in C++, basically a composite file is a file containing files, (examples: .docx, .jar, etc) these files can usually be renamed as .zip and opened with a .zip ...
1
vote
1answer
127 views

Pattern for dealing with different File Types

In my application I fetch files from the user and process it. Im to limit to a certain scope of file types and each one of these has a different processing approach. How can I design the application ...
0
votes
1answer
63 views

Modeling database to store files and search its content

I have a functionality which I must deal. The requirement of a project is to transform papers to pdf and store this files. The main functionality is that the user is being able to search words in the ...
0
votes
1answer
224 views

Optimizing a function that seems to execute really slowly when there are a lot of usernames in the file

I wrote a small program, about 10,500 lines and everything works perfectly. It is a Math game, which has is login and sign-up process and all data is stored on the user's computer in multiple text ...
1
vote
2answers
161 views

Visual Basic Writing to File with Numbered Lines

This is more of a design/user experience kind of question, so if it belongs somewhere else please let me know. I have a program that has multiple PictureBoxes: PictureBox1 PictureBox2 . . ...
0
votes
0answers
65 views

Options for Dumping Java objects to a file for import

Background: I am in the process of writing a suite of applications and have been tasked with tracking "metadata" across the app. This task requires me to process, export, then import, a large amount ...
2
votes
1answer
572 views

How can the PHP send a file to Java api?

I am currently working in a project that is to build a online judging system like codeforces. That is where someone can upload a file for a programming solution and our system will compile the code ...
0
votes
1answer
751 views

Designing a RESTful API for a file manager

I am building a file manager web UI (front end ReactJS, back end Flask). RESTful API seems to be very suitable in this situation at first sight, but I get into trouble. I need API contain: List ...
1
vote
2answers
76 views

How can I efficiently add/delete/get sorted data in Java?

I am writing a telephone directory program and need to store the entries in a CSV formatted file. However, I am having difficulty keeping the entries in order when adding. I was considering reading in ...
2
votes
1answer
103 views

Writing Automated test cases for a folder Archiving Class.

Using C# and Visual Studio, I've developed a class that zips and archives a folder into desired location, creating directories and manipulating files on a machine. The intended use is as an part of ...
3
votes
1answer
3k views

Forward Slash vs Back Slash vs File.separator in Java

I've seen some programmers doing the following : File file = new File("folder\\subfolder\\subsubfolder"); And I find it totally wrong because of compatibility issues with a different OS than ...
74
votes
6answers
14k views

Should temporary files be saved to /tmp or the current working directory?

I have a program that needs to generate temporary files. It is written for cluster machines. If I saved those files to a system-wide temporary directory (eg: /tmp), some users complained the program ...
3
votes
1answer
555 views

What is the most sensible design for making files available for download from a URL?

This is what I need to do, in a nutshell: Generate Excel spreadsheet files (programmatically). Store these .xlsx files in a location where they can be accessed by users later. These files need to be ...
20
votes
4answers
5k views

Using flat files vs database/API as a transport between a frontend and backend

I've got an application which has generated a rather heated discussion between a couple of the developers. Basically, it's split into a web layer and a backend layer. The web layer collects ...
0
votes
2answers
992 views

Undo/redo implementation for file changes in PHP

I was thinking to store all file operations inside an array, along with the reverse operations which are used for undos. Example: [ [ 'op' => 'move', 'parameters' => [$path_from, $...
1
vote
2answers
178 views

How are non-folder files called? [closed]

Maybe it looks like a weird question, but what term should be attributed inside the code for files that are not folders to differentiate them from folders? If I need write 2 functions isFolder() and ...
1
vote
2answers
141 views

Can version control systems use the filesystem log to capture changes?

I was trying to find a "perfect" syncing program between a network share and a local folder, when I realised that it's probably impossible to do it right unless all the filesystem operations were ...
3
votes
1answer
62 views

Is there a convention for where to store crash-recovery files?

I work on an application where we have the potential to attempt a file save in the top-level exception handler. The intention would be save a file which can then be sent into the support team, ...
0
votes
1answer
74 views

Handling Upload Of Unknown File types

A support ticket has been raised whereby a mac user saved a file from an email, then uploaded it to our web based system. By default, when doing this the mac does not save the file with a 3 letter ...
2
votes
1answer
589 views

Handle files on a remote location

Our intranet application is used to document and store office files. Both app and server are hosted remotely on the same server. Due to fact that our app server is changed every couple of years, we ...
1
vote
1answer
185 views

Working with external translators in .NET

I am working on a .NET project (happens to be an MVC website) that is being deployed in 5 languages. We have several hundred text strings in various .resx files, which is working great. However, the ...
1
vote
1answer
53 views

How to deal with dual servers and temporary files

Our application is hosted on a dual-server environment - when one server is overloaded with work, a secondary server will take its place in processing certain actions. For most purposes, this isn't a ...
6
votes
3answers
780 views

Where in an MVC web application should writing files locally go?

In my web application that uses an MVC framework which has different modules for models, views and controllers I talk to several databases and APIs. Those are implemented as individual models. A lot ...
0
votes
1answer
99 views

What locking mechanism should be used when persisting data to files

I am beginning to learn how to create web applications from a golang tutorial. For simplicity, it persists data to files instead of a database. The complete code creates a server that can handle ...