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

Filter by
Sorted by
Tagged with
3 votes
2 answers
167 views

Add offset to all filenames

From all the files in a directory, the method shiftFilenamesOffset is to increment the numeric part (int) of the alphanumeric filename by offset each time, and ...
Tobias Grothe's user avatar
2 votes
2 answers
176 views

Duplicate a folder tree over a network in C#

I have been tasked in creating a method that would replicate a full directory tree to a remote server using C#. The problem there is that I can only create the folder or the file if it has a parent. I'...
user10191234's user avatar
3 votes
1 answer
77 views

Bash script to clone directory structure with renaming

I've written a script to aid in creating new watchfaces for the awesome AsteroidOS project. A watchface there typically consists of directory structure like this: ...
Edward's user avatar
  • 65.3k
2 votes
3 answers
281 views

Java logger (of doom!), updated

In a previous question, Java logger (of doom!), I had posted my own logger, written in Java. I have since taken the answers from that question and a few of my own things to update it. New code: ...
CATboardBETA's user avatar
13 votes
7 answers
2k views

A binary 3D model format for a game

I've recently started working on my own game engine and I have been thinking about creating my own model format. Since text usually takes a long time to load and process I decided to make a binary ...
Leocat's user avatar
  • 135
8 votes
3 answers
475 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 ...
Edward's user avatar
  • 65.3k
1 vote
2 answers
63 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: ...
DBalazs's user avatar
  • 11
6 votes
1 answer
88 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-...
Tom Hosker's user avatar
4 votes
1 answer
214 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 ...
Neil's user avatar
  • 1,050
1 vote
0 answers
111 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? ...
CyborgBeta's user avatar
1 vote
0 answers
105 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 ...
Jaydeep Vyas's user avatar
5 votes
2 answers
3k 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 ...
user avatar
7 votes
1 answer
1k 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 ...
Nikita's user avatar
  • 73
4 votes
2 answers
184 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 ...
Denis Leonov's user avatar
4 votes
2 answers
83 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 ...
logo_writer's user avatar
2 votes
0 answers
171 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 ...
the_endian's user avatar
  • 1,343
4 votes
1 answer
201 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 ...
nealei's user avatar
  • 41
2 votes
0 answers
127 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 ...
JLegendre's user avatar
  • 121
7 votes
1 answer
435 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 ...
Edward's user avatar
  • 65.3k
13 votes
0 answers
326 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 ...
Douglas's user avatar
  • 859
3 votes
1 answer
581 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 ...
loremIpsum1771's user avatar
4 votes
1 answer
752 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 ...
Joseph Palomino's user avatar
3 votes
1 answer
110 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 ...
Baldr's user avatar
  • 91
0 votes
1 answer
84 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 ...
blacksite's user avatar
  • 195
4 votes
2 answers
937 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 ...
BrainStone's user avatar
11 votes
2 answers
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 ...
Manuel Alejandro's user avatar
14 votes
2 answers
3k 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 ...
Kaz's user avatar
  • 8,810
6 votes
2 answers
112 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 ...
Kaz's user avatar
  • 8,810
9 votes
2 answers
986 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 ...
pfinferno's user avatar
  • 447
4 votes
1 answer
284 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. ...
Robert Snyder's user avatar
4 votes
1 answer
84 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. ...
Spencer's user avatar
  • 217
7 votes
2 answers
165 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 ...
Kaz's user avatar
  • 8,810
6 votes
2 answers
176 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: ...
Can O' Spam's user avatar
6 votes
1 answer
169 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 ...
Majiick's user avatar
  • 63
7 votes
1 answer
147 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 ...
user82726's user avatar
4 votes
1 answer
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 ...
jpmorr's user avatar
  • 141
2 votes
0 answers
874 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 ...
outoftime's user avatar
  • 1,729
4 votes
1 answer
1k 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 ...
Dom's user avatar
  • 183
3 votes
1 answer
4k views

Creating a directory structure from JSON

I have a JSON file: ...
Prashant Gaur's user avatar
2 votes
1 answer
462 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: ...
Dux's user avatar
  • 223
8 votes
3 answers
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 ...
Dux's user avatar
  • 223
4 votes
1 answer
349 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 ...
user avatar
8 votes
4 answers
6k 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 ...
BoeseB's user avatar
  • 378
3 votes
3 answers
3k 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 ...
user avatar
7 votes
1 answer
761 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 ...
bazola's user avatar
  • 8,579
10 votes
2 answers
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 ...
teuna's user avatar
  • 101
5 votes
1 answer
153 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 ...
Ryan's user avatar
  • 185
5 votes
2 answers
174k 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, ...
KyelJmD's user avatar
  • 193
2 votes
3 answers
110 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, ...
Chi-Lan's user avatar
  • 121
1 vote
1 answer
167 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. ...
nobody's user avatar
  • 125