Stack Exchange Network

Stack Exchange network consists of 175 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 [files]

The tag has no usage guidance.

-1
votes
2answers
82 views

How to append a chunk of fixed size data to a file and make sure this chunk doesn't get fragmented on disk?

So i want to understand how DBMS implementation works To give an example : MySQL implements each tables with its own pages, which are 16KB so each table is a file, and is a multiple of 16KB, ...
6
votes
6answers
619 views

Is duplicating files to avoid programming branching a good or anti pattern?

for example, suppose I need to play different sounds according to "grade": file list: fairSound.mp3 goodSound.mp3 excellentSound.mp3 code: showResult(grade){ if(grade==0 || grade==1){ ...
1
vote
3answers
220 views

Why do disks write data in chunks of page size?

In my understanding, even if i want to overwrite a byte in middle of a file, OS and/or disk will read the content of the size of page, modify one byte and then write the contents back. What is the ...
-2
votes
1answer
88 views

Standard for config file location? [duplicate]

My program (a command-line utility) will load configuration from a file, using defaults if file not found, and I'd like to do this in a cross-platform manner that people will expect. Is there a de-...
3
votes
1answer
239 views

What's the best approach for using Git for a project containing a largish binary database (4 GB, 4000 files)?

The codebase consists of 190 Fortran 95+ source files, and directory of binary coefficient files required for the use of the code. The binary directory contains about 4000 files, some of which are ...
1
vote
3answers
220 views

Why would I use a queue to list all files and subfolders recursively

In Robert Sedgewick's Algorithms book there's this exercise: A folder is a list of files and folders. Write a program that takes the name of a folder as a command-line argument and prints out all ...
1
vote
2answers
129 views

Best approach to persist settings in files

I am in the process of migrating the way an app makes persistence of its settings. It wrote and read data from registry; now it is desired it load/save XML files on the C:\AppData\MyApp\Version ...
0
votes
1answer
85 views

Find Randomized Sequence Seed To Compress files statistically

I was wondering if what I have in mind already exists in any known compression programs/algorithms or not. We know that Seed gives us constant sequence of random numbers. so if we be able to find seed ...
1
vote
0answers
161 views

Is the readability of file list in IDE a reason to keep empty .cpp file?

Sometimes I just need .h but not .cpp file, eg : interface class or enum class, and when the class list is displayed on file list of IDE (eg:Xcode): Animal.cpp Animal.h Cat.cpp Cat.h Dog.cpp Dog.h ...
0
votes
1answer
533 views

File Transfer over Socket

I'm trying to build a simple file transfer program that transfers a file from a server to a client. I gave it a try myself by simply writing the file to an ObjectOutputStream. This didn't work. I did ...
4
votes
2answers
196 views

Why doesn't Git set the file time?

Git by default lacks the logic to set the file-time accordingly when the files are synced with the origin. It just ignores the file-time of the origin, and IMO this is a really annoying behavior. ...
0
votes
0answers
262 views

Managing an index of file metadata on a network share

What is a good way of setting up a "shared index" of file metadata, when there can be no shared process such as a database server? I'll explain the scenario: A server contains M (say 10000) large ...
0
votes
1answer
2k views

Project structure and folder naming

I have a cpp project which source code I want to split into 3 groups and want to define structure for these files by creating folders with nice name. First group are files related to socket ...
6
votes
1answer
1k views

What is the name for the non-extension part of a filename? [closed]

Given the file path: /some/path/abc.txt The filename is "abc.txt", and extension is "txt". What is the "industry standard", unambiguous name for the "abc" part? For reference, in both java's older ...
-1
votes
1answer
225 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 ...
3
votes
2answers
461 views

Where to store many files?

I have 500.000 files with the combined size of 350GB. So an average file has 0.7MB size. Each file has metadata: 1 to 100 keywords and optionally a short description. I need to filter the files and ...
-1
votes
1answer
746 views

Uploading large files to web-server even if browser closed

I need to permit users to upload large files to my web-server even if the browser is closed. How can I implement this functionality. I have gone through the feasibility of google drive app but it dose'...
0
votes
1answer
2k views

Find if certain files have been added or removed in large directory structure

I have a larger directory structure (dir + sub directories) with files. It contains files of certain types. For one particular type (let's say with appendix .foo) I need to figure out if files have ...
6
votes
1answer
94 views

Optimizing a file type for compare tools

Context: I am developing a visual studio plugin that generates layer diagrams. I want the tool to be able to produce an intermediate output, which is the data representation of what is being rendered ...
1
vote
1answer
311 views

What mechanism/protocol transmits non-HTML files when downloaded from the web?

When a non-HTML file such as a PDF, DOCX, EXE, etc is made public to the WWW by an HTTP server, and a client makes a request for said file, www.example.com/download?=test.doc what facilitates the ...
185
votes
15answers
32k views

Why are the sizes of programs so large?

If we look at the vintage program Netscape Navigator or an early version of Microsoft Word, those programs were less than 50 MB in size. Now when I install google chrome it is 200 MB and desktop ...
0
votes
1answer
1k views

Improving performance with caching of files in C# [closed]

EDIT: You were right, the problem is not checking if a file with the same name exists but the connection. I made a mistake measuring the time with StopWatch and included a part which used the network ...
2
votes
3answers
416 views

long (or bizarre) file paths

I know that (on Linux at least, with native file systems like Ext3) file paths can in theory be quite long, and PATH_MAX is often (but not always) as big as 4096 (see this; and this explains it could ...
5
votes
2answers
10k views

Move Files Using Git mv Or Use File System Instead

I am wondering what the difference in Git would be if I used the mv command versus moving it in Windows explorer. From Perforce I know it's important because the version system keep track of the file ...
0
votes
5answers
2k views

Do bare computer systems (without OS installed) use (executable) files? [duplicate]

As far as I read, files are introduced in OS books. Before an OS is installed on a bare computer system, does the computer use files? In particular, executable files have formats in OSes, e.g. ...
3
votes
2answers
2k views

Should log/data files be stored in the database? [duplicate]

I'm working on a project where we produce lots of data in the form of simple .txt files. These usually contain a set of columns that will later be loaded in to Matlab to be analysed. I've implemented ...
0
votes
2answers
197 views

At what point should you start putting functions in a new file? [closed]

I'm currently writing a python script. It's currently about 400 lines long, and it seems like it's getting a bit long, as when I'm trying to scroll through it with eclipse it takes a bit to get from ...
0
votes
2answers
7k 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
502 views

Why do we need a format for binary executable files

When binary files (i.e. executables) are saved they usually have a format (e.g. ELF or .out) where we have a header containing pointers to where data or code is stored inside the file. But why don't ...
8
votes
7answers
3k views

Why can we not insert into files without the additional writes? (I neither mean append, nor over-write)

This occurs as a programming language independent problem to me. I have a file with the content aaabddd When I want to insert C behind b then my code needs to rewrite ddd to get aaabCddd Why can ...
15
votes
2answers
4k views

Version number as a part of a file name

I see that some software have the version number included as a part of their file name, while others do not. I am more used to the latter type, and I think that is more popular, but I see the former ...
0
votes
2answers
853 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 ...
1
vote
1answer
89 views

Many JS files included, one breaks all, smart approach to fix? [closed]

I'm doing a project that uses svg-edit(JS drawing tool) and the page grows big. By now there are about 20 JS file in a page - plug-ins and so on. One of the editor's files breaks in some kind of '...
8
votes
3answers
1k views

Should I store test files in source control?

I have a number of (large) test files that need to be maintained. This means access to their history is a requirement. Benefits Any new developers get the entire test suite with just a git pull. The ...
5
votes
5answers
494 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 ...
4
votes
5answers
1k 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 dictionary,...
1
vote
2answers
801 views

Why do CSV file formats normally use quoting instead of escaping?

There are a lot of variants of the CSV "standard" (or lack thereof). I've never personally see any that use an escape character (like \) instead of surrounding each field with double quotes. Instead ...
6
votes
3answers
9k views

What is the most optimal algorithm for counting lines of text in a file?

File > 5Gb, simply with lines like apache access.log. Need to get number of lines. Any constructions like file(filename).read().counter('\n') Would read all of files and it would be very long time....
1
vote
2answers
4k views

All images in one folder for a website?

When creating websites, is it better to have a lot of images in one folder, or have them separated? It's something that has always been in my mind but I never researched enough about it, and googling ...
1
vote
1answer
1k views

Watching file changes/additions/removal, but with an eye on partial transfer

I would like to monitor the filesystem in python, so that my application gets warned of the new file addition, file removal, or file change. Once the file is detected, the application starts ...
3
votes
1answer
1k views

Reading from a file and inserting into a database, a good practice

I am making an Android application which reads several JSON files and inserts the read information into tables in my database. For instance, there are three files: countries.json { "countries":...
1
vote
1answer
1k views

Using assembly to write to a file

I am working with a trading application (reading data from the exchange) which generates a bucket load of data on a per second basis. We have different "log-levels" but even the minimal log-level ...
0
votes
3answers
392 views

Is there a manageable way of keeping track of loose code? [closed]

I program simple tasks everyday, but I have a hard time finding the scripts, and code snippets I write. Is there an manageable way to keep track of this sort of thing?
0
votes
1answer
1k views

Increase the size of a memory mapped file

I am maintaning a memory mapped file to store my tree like datastructure. When I'm updating the datastructure ,I got this problem. The file is limited on it's size and can't be too long or too small. ...
2
votes
4answers
1k views

Implementation ideas to store multiple files within a single file for faster access?

My requirement is to store a large number of files within a single file.The files stored could be anything like images, videos or simple text files as well. I want some ideas to implement the same. I ...
-1
votes
2answers
344 views

Ideal “intermediate” file format to use for structured/styled text? [closed]

I have files that I want to make available in an variety of formats: HTML PDF EPUB Plain Text (maybe) Most of the files will be sourced in doc, docx, or rtf format, so that needs to be considered. ...
1
vote
1answer
908 views

Heredoc or an external template file in my bash script - how it affects readibility/maintanance?

I realise that this question may be down to personal preference but I'm pretty new to Bash / shell scripting so thought it'd be worth some research to see if there's some sort of standard/best ...
2
votes
2answers
134 views

What is the best strategy for transforming unicode strings into filenames?

I have a bunch (thousands) of resources in an RDF/XML file. I am writing a certain subset of the resources to files -- one file for each, and I'm using the resource's title property as the file name. ...
4
votes
9answers
552 views

What is a widely accepted term for a string variable that would probably contain a file path and file name?

For functions that need to index files in a directory and rename them FileName0001, FileName0002, etc... I often need to write a function that splits the file name from the file path and rename the ...
4
votes
3answers
2k views

How do programs like subversion detect when a file has been edited as opposed to created/deleted?

This is my first question here so I hope it is not off topic. Although I am using the Linux inotify library to listen for changes to files, and I compare use of that against the Subversion program, I ...