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 [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.**

7
votes
1answer
64 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 ...
4
votes
2answers
55 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
60 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 ...
2
votes
0answers
50 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 ...
4
votes
1answer
161 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 ...
2
votes
0answers
58 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 ...
7
votes
1answer
264 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 ...
1
vote
0answers
62 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 ...
10
votes
0answers
206 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 ...
2
votes
1answer
314 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 ...
4
votes
1answer
76 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 ...
3
votes
1answer
68 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 ...
0
votes
1answer
69 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 ...
4
votes
2answers
553 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 ...
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 ...
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 ...
6
votes
2answers
86 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 ...
9
votes
2answers
714 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 ...
4
votes
1answer
195 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
52 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. ...
7
votes
2answers
143 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 ...
6
votes
2answers
154 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: ...
6
votes
2answers
105 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 ...
7
votes
1answer
122 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 ...
4
votes
1answer
4k 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 ...
2
votes
0answers
753 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 ...
4
votes
1answer
820 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 ...
3
votes
1answer
2k views

Creating a directory structure from JSON

I have a JSON file: ...
2
votes
1answer
329 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: ...
8
votes
3answers
1k 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 ...
4
votes
1answer
322 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 ...
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 ...
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 ...
1
vote
0answers
102 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 ...
7
votes
1answer
752 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 ...
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 ...
5
votes
1answer
143 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 ...
5
votes
2answers
143k 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, ...
2
votes
3answers
99 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, ...
1
vote
1answer
148 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. ...