Questions tagged [file-system]

Use this tag for reviews of code that performs file system operations, such as creating, deleting, renaming, moving, copying, reading, and writing files.

58 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
0answers
265 views

Copying folder contents from several folders

I have a file directory which contains folders for every month, and within those folders are several text files. In this context I would like to copy all of the text files from my ...
5
votes
1answer
89 views

EEPROM-based filesystem, aiming for Misra C++ 2008 compliance

I'm writing code for embedded systems (IAR compiler) and it should adhere to Misra C++ 2008. This limits the available features of the language quite a bit: no C++1x features use of the standard ...
4
votes
0answers
52 views

Sandbox file system for Java

I've recently started work on a hobby project that's basically a sandbox file system written in Java, slightly inspired by PhysicsFS. The point of the project is to separate what files a user can read/...
4
votes
0answers
32 views

Combining CSV files of simulation results

This script is a subset of a larger script where I have the output of many test simulations in the form of CSVs. Each file starts with the model name and includes the number of elements in my file. ...
4
votes
0answers
258 views

Generate NDVI Rasters from USGS EarthExplorer Landsat 8

I've written the following using Python Dictionaries and Pathlib Module. I'd like to improve the first function: list_landsat_bands. I've created a list of file patterns to match, which I then use ...
4
votes
0answers
190 views

In-memory file system context for the behat PHP BDD testing framework

I wanted to come up with a 'utility' context to enable testing of the file system with behat. Specifically this is aimed at helping with the behavioral testing of php command line applications that ...
4
votes
0answers
2k views

Python files sync

I'm trying to do a one-way directory sync. Given a list of existing files in a dir, I'd like to make the files in the dir equal a new list of files. There will be subdirs under the dir. Because ...
4
votes
1answer
93 views

File read/write methods

I'm using some simple files for caching and some basic user data. I was first just using file_put_contens and file_get_contents, ...
3
votes
0answers
35 views

Adapter pattern to support multiple file storage systems

I am just getting in to following design patterns. I have create a class that allows for performing a couple operations on different remote storage systems: drive, dropbox, .etc (I call these ...
3
votes
0answers
37 views

SHA256 directory hash

I'm pretty new and I posted on SO earlier because I wanted to make sure my code was right and all that and I got redirected here. So I have this code that I put together (using Example C Program: ...
3
votes
0answers
62 views

Print a list of disk blocks used by file(s) - Linux

This code takes a list of filenames as arguments or from stdin (or from a provided file) and dumps a list of disk blocks used by those files. An attempt is made to use the linux ...
3
votes
0answers
105 views

Follow-up: Script to create symlinks for dotfiles in a Git repository

This is a follow up to my previous question on Code Review. I did try to implement most of feedback provided by thiagoalessio. This is what my updated code looks like: ...
3
votes
0answers
33 views

Rewriting the GnuWin32 Touch Command with the Win32 API

There are essentially two options for Windows users accustomed to the *nix command-line functionality; you have to either download a framework like Cygwin/Msys or use the GnuWin32 packages (of which I ...
3
votes
0answers
681 views

Compressed static file serving in flask

Flask comes with built-in static file serving, but compression support is completely missing. I think the way whitenoise implements it and compress files during builds. The following should serve the ...
3
votes
0answers
499 views

Recursively list files in provided directory in the style of `npm ls`

I've written a small CLI node program to list the contents of a directory with an output similar to that provided by npm ls but listing both files and directories, ...
2
votes
0answers
34 views

Implementing an efficient async FileSystem class based on libuv in C++

I currently am working on a game engine written in C++ with libuv backed for io system calls. I have a FileSystem class that just 'works'. I am allow to read files without blocking but the current ...
2
votes
0answers
33 views

Bulk File Rename; Improved Safety and Performance

A function that funnels all filenames into a file and opens that file in vim. The user then changes the names, saves, and quits. Finally the function renames the files in the folder with the new names ...
2
votes
0answers
53 views

Minimal Static Site generator

For my first project with Rust, I decided to try and implement a minimal static site generator. I've never had any code review, and I've been looking for some feedback so I can get better! Brief ...
2
votes
1answer
34 views

Creating a file of md5 hashes for all files in a directory in PowerShell

I have been trying to write the md5 hashes for all files in a directory and its subdirectories to a file. Ideally, replicating the output of the Unix command ...
2
votes
0answers
51 views

File-system based queue in python

I would like to implement a concurrent (multi-thread, multi-process) queue that is backed by file system. Data is pickled over a file, stored in a directory and given a sequential name. The ...
2
votes
0answers
26 views

Printing files count and size of a directory tree

I've written a small package that counts the files and the size by file type in a directory tree. It produces the result as a markdown file. Here is a sample: ...
2
votes
0answers
27 views

Script to report disk usage

I am trying to see how I can speed up the below script that reports disk usage. The timed find command towards the end is the problematic line that I am trying to ...
2
votes
0answers
48 views

Attempt to save (recover) files from a broken external drive

My external drive that I use for Backup had some broken files. I feared that I'd lose some (or all) the data in there. So I wanted to copy each and every file to my hard disk. I first tried using ...
2
votes
1answer
51 views

Powershell for syncing Minecraft save files

My code in full plus the task scheduler definition: https://gist.github.com/DaneWeber/0c5e7978bd3927734173e3afdc3d6338 This is my first non-trivial PowerShell script. This was a pretty major learning ...
2
votes
0answers
42 views

Class to construct paths based on the path to the current class file

I have written a class that locates relative root project directory path from where I'm calling that class. E.g. I have structure: ...
2
votes
0answers
547 views

File shredding (secure deletion) algorithm

Does anyone see anything wrong with this? I was considering using something like srm or wipe and use ...
2
votes
0answers
143 views

Syncing NTFS permissions with SMB share permissions

I recently wrote scripts to automate the setup of shares on a server using the New-SmbShare cmdlet. I hadn't realised that this cmdlet doesn't automatically amend ...
2
votes
0answers
513 views

C# FileSystemWatcher Manager with Debounce

For a class last fall I was working on a "cloud backup" system. Originally in Pascal, I decided to rewrite it in C# and expand the feature set. Below is the FileSystemWatcher "manager" class which ...
2
votes
0answers
460 views

Get process max memory usage while copying large data

I want to check the memory usage of a process before and after I copy a large file or folder, and also, I want to get the maximum memory usage during file operation. Is this a good method? ...
2
votes
0answers
50 views

Concurrently identify duplicate files from size ordered list

Following on from my program to identify files that have common file sizes, I have developed an application that takes the output from that process and then compares each of the files that are the ...
2
votes
0answers
145 views

Frequency of words in all files of a directory using Future - Scala

I created a program to get frequency of word in all files in a directory using Future API ...
2
votes
0answers
272 views

PHP upload class

I know there are many PHP upload classes out there, but I'm comfortable with my own code, so I made a simple one here. What do you think of my approach when isImage...
2
votes
0answers
2k views

Automatically redirect /index.php files to their URL directory with .htaccess

The requirements: Work inside .htaccess (preferably via mod_rewrite) Redirect requests from /any/directory/index.php to ...
1
vote
0answers
12 views

List files and folders in current dir with special handling for tty

I want to write a custom ls command to learn rust. This is what I've done as for the version 1.0. This display files and folders in a cyan or white if it's on a ...
1
vote
0answers
34 views

Photo rename by Exif date and group into folders with a threshold

I wrote this tiny F# project yesterday, but I am a bit rusty and I would like to know if there is anything I can refactor and make more elegant. ...
1
vote
0answers
25 views

Average histogram combining multiple files and vector of vectors (in c++)

I run a program of simulation N times (I use each time a different random numbers to initialize it). The results of the program are stored in 2N directories: every run produces two approximations. The ...
1
vote
0answers
87 views

Implementing std::filesystem::remove_all() for Android

I needed to use some c++ code on both standard Linux and the Android variant, and the code will use filesystem library but it isn't yet in the ndk. So I'm making a one to use on Android It will be ...
1
vote
0answers
33 views

Python script to add unittest decorators to source code files

This is a simple Python script to add @unittest.skipUnless() decorators in a specified format above every function starting with ...
1
vote
0answers
43 views

Java Multipart text file analysis to zip

So I am working on a project that should take .txt file as an input and analyze words in it (assuming all words are English). Program must run asynchronously. Final output should be multiple .txt ...
1
vote
1answer
96 views

Short Ruby program that opens a random video file from a directory

I am currently learning to code in ruby. I have created a small program that iterates through a directory of video files and opens one at random. The program is fully functioning (with the odd issue). ...
1
vote
0answers
48 views

Move image files according to watermark identified by a neural networks

I have created a neural network that can identify watermarks and can classify them to which company do they belong. Now I created a script that will identify watermark from a folder and move them to ...
1
vote
0answers
780 views

XignCode Bypasser installer for Blade & Soul

As the title says, this batch script installs the XignCode Bypasser. Xigncode is a software bundled with games to analise running programs and prevent cheating. (Sometimes, it prevents the game to ...
1
vote
0answers
57 views

Async function to write products to file

I'm currently trying to learn how to use await/async functions. Could anyone offer any thoughts on how to improve this function which uses await inside a for loop? ...
1
vote
0answers
40 views

Copy data for a list of stocks from all Excel files in a directory

I'm trying to do the following things. ThisWorkbook has list of stocks. By using for loop i'll select each cell. Number of rows in this sheet are 215. Create a new workbook with the name as above ...
1
vote
0answers
263 views

List all files matched by glob within JSON file

Based on a set of globs contained in a custom field within a package.json file, I'm trying to get a list of all the files that the glob matches. In my continual quest to get more familiar with ...
1
vote
0answers
132 views

Class for managing (file I/O) data

I want to make an attempt to write my own simple RPG. As a preparation for this task I created a class which I could use to store/retrieve my in-game objects data to/from disc. I chose JSON format as ...
1
vote
0answers
383 views

RSYNC Style Mirror Folder Application

I've written a mirror folder application in C#. It uses CommandLine for command line parsing. I'm just looking for a general review. ...
1
vote
0answers
52 views

Event log implementation with TDD

Below is some code that implements an 'event log' whose purpose is to record events and periodically check that all events were recorded in chronological order. The collection of events must be ...
1
vote
0answers
446 views

Tab completion for custom shell

The purpose of the code is to enable tab completion for a custom shell I'm writing. The target OSes are Linux and OpenBSD. I had to make a conditional include that I hope is correct: ...
1
vote
0answers
760 views

Simple program that copies just new files from one directory to another

I'm doing a Python course for beginners, and the last assignment was to create a program using shutil and wxpython that can copy new files (created in the last 24 hours) from one folder into another, ...