Questions tagged [file-structure]
A file structure is a way of organizing files in a fashion that allows them to be queried and/or updated efficiently. **Please do not use this tag to ask about project structure.**
47
questions
14
votes
2answers
1k views
Regex Matching a Naming Convention
Program Purpose
So, I have a naming convention for certain folders.
I want to take in a folder name, and determine if it conforms to the convention.
Naming Convention
The convention (case ...
11
votes
0answers
258 views
Code to fill PE import address table
I wrote a program to test AV engines against encryption. When it runs, it will compute some key, decrypt an executable it has in its data section and copy it to the locations where the executable ...
10
votes
2answers
1k views
Reading a repetitive file with repetitive code
I made this code for take some data from a .txt file. The text file is a large list of data from temperature with a format that is repetitive and have some lines at the beginning with the station ...
10
votes
2answers
2k views
Intranet PHP application
I'm more of an IT guy (no CS course) with a strong and passionate relationship with Unix and I love KISS.
I'm writing an application to help my coworkers with their daily tasks. Every now and then I ...
9
votes
2answers
848 views
Reading binary files in XTF format
I have a few thousand binary files that have corresponding structs in them, followed by any number of bytes (this exact number of bytes is given in one of the fields in the structs). I read in data ...
8
votes
4answers
5k views
Reading a text file that contains several CSV-like tables
I wrote some extension methods to read CSV-styled text directly into a datatable or dataset or write them to this format. Is it right to use the methods as extensions or should I create a separate ...
8
votes
3answers
360 views
Sinclair Spectrum TAP file dumper
The other day, I had occasion to want to look into an ancient piece of Z80 software written for a Sinclair Spectrum computer. Software for this machine was typically saved to audio tape, and today ...
8
votes
3answers
2k views
Parsing oscilloscope binary data
I wrote a simply parser for Tektronix's internal binary file format .isf. The code is supposed to read in the file and return the header data as well as the actual ...
7
votes
1answer
754 views
Save Games on iOS with NSCoding
This is the second time I have implemented saving and loading for a game using Objective-C. I am using the built in NSCoding methods. I would love to hear opinions about NSCoding and whether or not ...
7
votes
2answers
150 views
Parsing 4 Million Filenames
This is the next step in my project to query Companies House records. The first step, retrieving and validating the company numbers to be targeted, was covered here and I will include that code at the ...
7
votes
1answer
512 views
Parse a WAV file and export PCM data
I'm a newbie and I wrote code that gets a WAV file and exports a RAW (only PCM data) to *.raw file. But I am confused about the structure. The code is written as one procedure (LISP style) and there ...
7
votes
1answer
133 views
Nothing compiler/interpreter, Part 2
Part 1
I've followed some of the suggestions:
Adding newlines to error messages
Implementing options (I decided to use boost instead of getopt)
Using strerror for fstream failure
Allow multiple ...
7
votes
1answer
321 views
Binary test file generator with checksum
In reading this question, it occurred to me that it would be helpful to create test files according to the file format specification. To recap, the file format is as follows:
File format
Note that ...
6
votes
2answers
94 views
Validating FileSystem Structure
I have a File System. It is *supposed* to be laid out / used / added to in certain ways.
This is a program to report on the *actual* state of the file system versus what it's supposed to be.
In ...
6
votes
1answer
73 views
Centrepiece Class from a Warehouse Management Package
Overview
I've just written a package in Python (which I've named sibstructures) whose purpose is to assist staff in managing a coldstore, which is a warehouse-...
6
votes
1answer
128 views
Pulling PE32 header info
Context Info
I coded up a program that maps an executable file(.exe .dll mainly) to the program's memory space which allows for easier extraction of the PE header info. I extract the information by ...
6
votes
2answers
160 views
Using PHP to create a file structure
I am using PHP to create a file structure in which to store XLSX files, for this I have created this class:
...
5
votes
2answers
159k views
Reading a line from a text file and splitting its contents
I have this kind of file structure
MALE:FooBar:32
FEMALE:BarFoo:23
Where I would want to identify the gender and age of person, ...
5
votes
2answers
998 views
Java program to detect the Java class File Format magic number, in a given file
Description:
I wrote a Java program that checks whether the content of the given file begins with the Java class File Format magic number 0xCAFEBABE, in big-endian ...
5
votes
1answer
144 views
Creating a Ruby gem that talks to another gem
I am working on creating an interface gem that works with the Jira-Ruby gem.
I have several questions and would like a general review for both my code and my attempt at creating a gem (I've never ...
4
votes
1answer
907 views
Key value flat file system - single header INI replacement
I'm very happy with the performance, but I always try to optimize my code as much as possible. Since I plan on using the code in production, I feel more save posting it here first. I probably missed ...
4
votes
2answers
683 views
In-place sorting of a binary file using heapsort
I have been working on sorting a file in-place with heapsort. I'm very glad it is working. But the time it takes is just too much. So I was wondering on how I could improve it.
Here are my ...
4
votes
2answers
85 views
Parsing Bitcoin binary data file with Python
The script parses Bitcoin database (blkXXXXX.dat) files directly from raw binary to txt human readable view. And I think about how to encrease the speed of processing.
Can anyone suggest how to ...
4
votes
2answers
68 views
Serial copying from disk images to folder in Bash
This is a Bash script that copies files stored inside disk images to a directory, using a defined structure provided via a JSON file. I've included the external programs it requires and the test I ...
4
votes
1answer
178 views
Updating data file records
I learnt to code a long, long time ago.
Concerns
Existing approach is messy and will be hard to maintain. System errors are not trapped and the error messages could be better implemented. Final ...
4
votes
1answer
56 views
Extract PNGs embedded in a file
My approach was to find each occurrence of the PNG's file signature followed by its end of file (EOF) and write the bytes between to a new file whose name is simply a counter starting at zero.
...
4
votes
1answer
216 views
C program that recovers lost JPEG files
My overall strategy is to load a block size (512bytes) into memory and check if that blocks first 4 bytes match a JPEGS first 4 bytes.
If it does then, I'll open a new out file and start writing the ...
4
votes
1answer
326 views
Huge terminal game (in development)
I'm developing a big (for me, as a beginner) terminal program "Brainfuck - The Game", in which you have to complete Brainfuck challenges. I would like your review on existing code (and project ...
4
votes
1answer
81 views
Read JPEG dimensions properly
I need to extract the dimensions (width and height) of a jpeg file for inserting in an html document. According to the JPEG image compression FAQ, cautions against what's commonly out there,
Some ...
4
votes
1answer
226 views
Marshaling data for a game
I've been working on a game that I used to play as a kid. This game was disassembled then converted to C# by someone else and they hosted it on Github. I've forked it and started working on it some. ...
4
votes
1answer
5k views
Makefile for compiling shared libraries
I have a makefile that I've been using to compile my shared libraries which reads in the files from different folders and then builds the objects and binaries in their own folders.
The folder ...
3
votes
3answers
2k views
CR2 raw image file parser in Python 3
I haven't used Python in a number of years, but recently started working on a project called Photoshell which is written in Python 3.
As I attempted to learn the "Pythonic way", I wrote a parser for ...
3
votes
1answer
79 views
Adding a new node in an AVL tree
I was working on a class assignment today and I wrote this code which works perfectly fine. It looks tho kind of has too much 'if statements' in it, and I was thinking that it could be written much ...
3
votes
1answer
409 views
Restructuring a file to JSON
I created a program that parses a Credit Reporting file which is in the Metro 2 file format as described here. Parsing a file is generally trivial but the issue is that in this case, there are no ...
3
votes
1answer
3k views
2
votes
3answers
102 views
Replace first occurrence of pattern in file
Here's my attempt to replace first occurrence of pattern in file with spaces. Effectively deleting it, and hopefully will allow me to "delete" it in a large file, ...
2
votes
1answer
361 views
Parsing oscilloscope data, follow up
Follow-up up on Parsing oscilloscope binary data.
I wrote a simple parser for Tektronix's internal file format .isf.
I revised my code to the following:
...
2
votes
0answers
80 views
DOS header parser in Rust
Looking for feedback mostly on the from() and printf() implementations but I included everything for context. Please do not ...
2
votes
0answers
80 views
Parse Mach-O binding info
I wrote this C program to open a Mach-O executable/framework and parse the external symbols along with their respective framework/library. A few things I would like to get better at:
Memory ...
2
votes
0answers
820 views
Simple clicker game
I have started my clicker game using angular.js about week ago. I have finished current functionality first night, but still have feeling of misunderstanding some basic approaches.
This is sources ...
1
vote
1answer
152 views
Iterating through 128-byte records in a file
I need to read records from a flat file, where each 128 bytes constitutes a logical record. The calling module of this below reader does just the following.
...
1
vote
2answers
55 views
Building a Building - Is the building clean?
I'm writing a small game and I use Kotlin for that. I want to model my buildings with the following class:
...
1
vote
0answers
64 views
Recursively look up directories, (a little bit) slow
I wrote some Java code to look up all files in a chosen directory (like it's showing in the Windows Explorer), and to display the results, but it seems to be slow. Can you tell me, how to speed up it?
...
1
vote
0answers
97 views
Clean way of passing parameters in swift
I am creating a user request model to pass-params for web service call
toRegisterParams() is used call register web service request
toLoginParams() is used call register web service request
so my ...
1
vote
0answers
70 views
Reading Files in a File Manager Plugin for WYSIWYG Editors
I recently created a file manager plugin for the TinyMCE, CKEditor and Redactor editors to ...
1
vote
0answers
107 views
Simple class container for hdf5 files
I implemented a simple class container for hdf5 files in matlab.
The situation is as follows. Measurement data is saved in hdf5 ...
0
votes
1answer
72 views
Ad-hoc analytics script to module/package
I have a text analytics process that I complete for work. This process mines text for different Twitter accounts and finds patterns in the tweets. The actual machine learning pipeline is much more ...