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.

Filter by
Sorted by
Tagged with
9
votes
2answers
2k views

Enforcing set environment variables

Context I have a node.js application that uses many other modules and libraries. Some of these modules pull details from process environment variables, such as URL's for databases, credentials, and so ...
25
votes
1answer
335 views

Follow-up to tool for posting CodeReview questions

Description This is a follow-up question to Tool for creating CodeReview questions. Things that has changed include: Removed replacing four spaces with one tab, all tabs and all spaces in the code ...
8
votes
3answers
792 views

Multiple file access abstractions

When using dependency injection for nearly everything it's good to have some file access abstraction. I find the idea of ASP.NET Core FileProvider nice but not sufficient for my needs so inspired by ...
3
votes
3answers
5k views

Change filename of Excel-files based on the content of a cell

I have hundreds of Excel-sheets looking something like this: I can't use the actual sheet, and not the exact document numbers, since they are confidential. The name of the files are something like ...
10
votes
2answers
508 views

Identify files within folder structure that have common file sizes

The code takes in two arguments, a path to search and an output file name. It searches the supplied path (including sub directories) and writes out all files that have the same size as any other ...
6
votes
4answers
9k views

Implemenation for concurrent file access (read/write)

I am developing an application that works with files and folder on a network share (similar to the windows explorer). The application is used by multiple users and provides some commands for modifying ...
20
votes
1answer
395 views

From new Q to compiler in 30 seconds

Reviewing code doesn't necessarily require actually building it, but it's often helpful to do so in order to evaluate fully. I usually create a CMake project and ...
18
votes
3answers
11k views

Implementation of the ls command with several options

As part of a past assignment, I've expanded on this implementation of ls to have more options available, including non-standard ones. It currently supports these (...
11
votes
2answers
1k views

Implementation of the ls command with several options - follow-up

I've made vast improvements to my previous ls implementation, including: Added new flags: -g (omit owner listing) ...
10
votes
1answer
50k views

Writing to file in a thread safe manner

I'm writing Stringbuilder to file asynchronously. This code takes control of a file, writes a stream to it and releases it. It deals with requests from asynchronous operations, which may come in at ...
21
votes
1answer
662 views

Regular backup/snapshots

A (long) while ago I set up a file server in my basement running Linux. I am OCD when it comes to backups. I set the server up with (remember, this was a while ago): disk for OS disk for 'valuable' ...
10
votes
2answers
203 views

Simulation of image transfer over noisy channel

Following this question, I've tried to rewrite some core methods to avoid using String for bit operations, and I ended up using ...
10
votes
2answers
366 views

Disassembler for intel 8080

I have written a disassembler for Intel 8080, able to translate binaries into opcodes and parameters. Sorry for posting so much code, but everything posted here is useful for the understanding of the ...
8
votes
1answer
238 views

Simulating image transfer over noisy channel with a repetition code

I need to write a software in JAVA which allows me to simulate the transfer of some images over a noisy channel while adding redundancy with a repetition code . Before going into code details and ...
6
votes
2answers
344 views

Walking directory tree like python does

I like python's os.walk and I was missing it in C#. It's a very convenient API so I thought I create my own utility that does something similar. The original API ...
6
votes
2answers
95 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
381 views

System backup on Linux

I've written this Python script to make regular backups of a Linux server. It works pretty well except that the script sometimes backups files more than one time, which is pretty strange and I don't ...
5
votes
1answer
357 views

Algorithm to categorize episode-file names efficiently

I'm trying to categorize file names of anime episodes (for now) into appropriate title based categories. The Show-titles are parsed from an XML file (I got from Anime News Network). EDIT: The passed ...
4
votes
2answers
91 views

Adding, removing, and changing user names and passwords in .htpasswd with PHP

Here is some code I wrote to add, remove, and change user names and passwords in .htpasswd with PHP: ...
3
votes
2answers
8k views

Find a specific file, or find all executable files within the system path

I wrote a function to find a specific file, or all the executable files with a given name and accessing flag, and I want to make ...
3
votes
1answer
69 views

Find matching image and metadata files, pull data and rename both

My Original - Read date from a file and rename two files using the date github if you want to see behind the scenes. I like taking pictures of birds. Lots of pictures of birds. My camera counts ...
3
votes
2answers
6k views

Program simulating dictionary using file handling

I have made a program in C++ simulating a dictionary with very basic functionality. I do not have much experience in file handling with C++. Also, I want it to run on Linux and Windows. It would be ...
2
votes
1answer
7k views

Clear cache files older than 30 minutes

This is what I came up with to delete files not modified within the last 30 minutes from a subdirectory named cache. ...
11
votes
4answers
615 views

Get Workbook Method(s)

I'm re-writing my Module of standard methods. These 3 are used to retrieve Workbooks as Workbook Objects. The standard I'm aiming for here is "Third-party Library/Add-in". So: Do these functions ...
11
votes
2answers
15k views

Powershell search millions of files as fast as possible

I once asked a similar question but in C#. Now I have the same problem in powershell.. What is the fastest way, to search files newer than 15 minutes, in a file system with more than 1 million files? ...
9
votes
3answers
234 views

Collate votes on MP3 files to list them by popularity

For my first Python project, I decided to create a script that would automatically collate MP3 files into a music countdown. I wanted to 'learn by doing', so I dived straight in and used the Python ...
8
votes
3answers
175 views

MP3 Vote Collator - Final

Here is the completed code for my first Python project, for which I received some help and feedback here: Collate votes on MP3 files to list them by popularity Seeing as there have been considerable ...
8
votes
3answers
2k views

“Scripting.FileSystemObject” Replacement module in VBA

I have found Scripting.FileSystemObject to be slow and unstable. Calling file_object.Name repeatedly has caused my code to crash excel on multiple instances. ...
5
votes
1answer
261 views

Python script to rename images based on descriptions in a text file

I like to collect images for my desktop background, but the problem is sometimes the image names don't represent what the image is. I decided to write a script that reads a text file that contains the ...
5
votes
1answer
126 views

Categorize episode-file names - Follow up

This is a follow up to this question. I have implemented changes to the code as they were suggested in the previous question and have made a few changes of my own. But it has been mentioned that the ...
5
votes
1answer
2k views

Replacing duplicate files with hard links

I'm a photographer doing many backups. Over the years I found myself with a lot of hard drives. Now I bought a NAS and copied all my pictures on one 3TB RAID 1 using rsync. According to my script, ...
4
votes
1answer
687 views

Script to create symlinks for dotfiles in a Git repository

I have a GitHub repository containing all my dotfiles for bash, tmux and neovim. I'm using a ...
4
votes
1answer
905 views

Media player subtitles in WPF - Part 1 Processing and storing

I'm writing a media player in WPF and since movies are playable, subtitles are a must. Here's what it looks like so far: On the left is the settings tab, in the middle is the actual player and on ...
4
votes
1answer
88 views

Mapping file data to environment variables

This is a follow-on to my previous question: Enforcing set environment variables While learning more about JavaScript, node, and the bluemix environment, I have been using the loading of process ...
4
votes
1answer
180 views

Copying into two different folders on a machine simultaneously

I am trying to copy files from machineB and machineC into machineA as I am running my shell ...
4
votes
1answer
85 views

Randomly choose a game executable from a folder

I've written a Universal Windows Application which allows you to select a folder and shows the icon and name of a random executable from anywhere in that folder. The intent is to be a Game Roulette, ...
4
votes
1answer
346 views

Security: Scale and cache images

Specification A simple PHP script resizes images on-the-fly. The script is called by the web server's 404 handler to return a scaled version of the original. For example, if the original image is at: ...
3
votes
2answers
2k views

Watch a directory and insert new entries into database

This program's main function is to: Watch a directory. If there are new files, insert those as entries into the database. Delete the files from the directory. My below code runs well, but I want to ...
3
votes
1answer
572 views

Recursively find TypeScript files imported/exported from an entry point

I'd like to know what's the best practice as functional programming in JavaScript to work with arrays and passing them as an argument to a recursive function that may run itself within its branch. In ...
3
votes
2answers
162 views

Run directory scan as Class

I've progressed with the directory statistics function and want to proceed by making it a class. Link to the first version of this code: Link My current state of things: About my namings: I first ...
2
votes
1answer
43 views

Detecting Dependencies in Common Lisp Project Files

The following short program is a collection of routines for detecting the dependencies among a project’s component files. Dependencies serve as a rough measure of the complexity of a program. ...
2
votes
0answers
37 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
1answer
476 views

Typescript: Recursion file-system lookup

Previously I asked a question to find the best practice of recursively running a function to retrieve all import/export statements of files in NodeJs here. After some discussion I'm not satisfied yet,...
2
votes
0answers
53 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 ...
1
vote
1answer
170 views

ThreadSafe IsoStorageManager

This is a continuation of the last thread. I wanted to add a thread-safety and I was considering AwaitableCriticalSection and Task+Mutex. I ended up with mutex; it can be a bit slower but it would ...
1
vote
1answer
57 views

Read date from a file and rename two files using the date

Problem I have image files that are RAW data and have the extension .NEF Whatever edits I make to these files are stored in what is called a sidecar file with the ...
1
vote
0answers
55 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 ...