Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

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
98 votes
6 answers
66k views

File Browser GUI

FileBro is a basic GUI based File Browser. FileBro Functionality Directory tree - shows the file system roots at start-up, but is otherwise built lazily as the user browses around the file system. ...
Andrew Thompson's user avatar
66 votes
3 answers
109k views

Delete folder if it exists in PowerShell

In my PowerShell script I'm trying to delete a folder, but only if it exists: if (Test-Path $folder) { Remove-Item $folder -Recurse; } I find myself repeating ...
Jeroen's user avatar
  • 1,441
33 votes
3 answers
813 views

Factor script to change case of all filenames in a directory

In the absence of a full-fledged tutorial, I am teaching myself to program in the Factor language by writing a bunch of functions that I will eventually use in command-line scripts. One common ...
Adeel Zafar Soomro's user avatar
25 votes
1 answer
352 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 ...
Simon Forsberg's user avatar
22 votes
1 answer
812 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' ...
rolfl's user avatar
  • 97.4k
20 votes
1 answer
457 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 ...
Edward's user avatar
  • 66.4k
19 votes
2 answers
35k views

Simple backup script in Python

Since rsync lacks compression and I'm not a big fan of rdiff, I thought I'd try my own little backup script. Since I'm very ...
magu_'s user avatar
  • 938
18 votes
3 answers
12k 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 (...
Jamal's user avatar
  • 34.9k
17 votes
2 answers
21k views

Python Back-Up Script

I wrote this script to backup some important files. It backs up the files to a local folder as well as to an external hard drive. It creates a new subdirectory which has its name constructed with ...
asteri's user avatar
  • 4,899
16 votes
6 answers
5k views

A file class for Python

This is the entire code segment. All the functions for file operations are working perfectly. I just need a professional to help me clarify that am following good standards, documentation, etc., ...
jamie_0101's user avatar
16 votes
5 answers
100k views

Reading all bytes from a file

I'm basically trying to write a helper function that reads a whole file and returns the data and the number of bytes read. Can you tell me if is correctly written and used? ...
aybe's user avatar
  • 612
16 votes
2 answers
1k views

Recursive directory tree printer

I wrote this program that recursively prints all the files and directories starting at the current directory: ...
hao's user avatar
  • 486
15 votes
4 answers
2k views

Python tool to organize downloaded media files

I'm making a file management project that I eventually want to be automated later in the future (once I learn how to). What it does is take files from my download folder and move those files to the ...
Tam-Fils Salomon'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,790
14 votes
1 answer
861 views

Loading a file from a FAT32 filesystem in 16 bit real mode on x86 (Intel syntax assembly)

I am writing a bootloader that needs to load a file from a FAT32 filesytem. Since I need to load both the root directory first to find the start of the file, and then the actual file, I wrote a ...
Adam C's user avatar
  • 243
13 votes
6 answers
840 views

Bash script that lowercases files

I have the following bash script that: Finds all files with .cfc and .cfm extension and converts them to lowercase Stores the ...
theblindprophet's user avatar
13 votes
5 answers
3k views

Portable old-school filesystem tool

I recently made a tool called mkfh to create a FHS compliant filesystem structure. I aimed to make it as portable as possible, so I wrote it in C89 and also tried ...
Labricecat's user avatar
12 votes
2 answers
1k views

Header-only log-structured database

I'm seeking a code review for the ~2000 lines of code. Makefile and tests are available at https://github.com/torrentg/logdb. I would appreciate feedback on the following aspects: Overall code ...
Gerard Torrent's user avatar
12 votes
2 answers
3k views

Generate a nested structure based on a list of file paths

I'm currently working on a small application, as a learning exercise for a Javascript novice. I need to generate an object based on a folder structure. Here is an example of the folder structure: ...
user avatar
12 votes
2 answers
898 views

A minimal CLI password storage and retrieval manager

Its primary function is to retrieve+copy a PW to your clipboard. It'll also add, update, delete key/value(accountName/password) pairs from a JSON formatted dictionary(separate .txt file). It's ...
Homer's user avatar
  • 287
12 votes
1 answer
187 views

Copy directories while changing Unicode filenames to ASCII

I created a short Perl 6 script copyfnameascii.pl to copy a file hierarchy I have, applying an URL Decoding to the names of folders and removing non-ASCII ...
user7610's user avatar
  • 569
12 votes
3 answers
961 views

Scanning a directory for plugins and loading them

I'm working on a simple dictionary tool, with a base class that can be extended by plugins to represent different dictionaries. The plugins are organized in the filesystem like this: ...
janos's user avatar
  • 111k
11 votes
3 answers
2k views

Path shortener for GUI application

I need to display a path within a GUI application. Displaying the whole path would be an overkill, so I made a custom path shortener. ...
Pella86's user avatar
  • 557
11 votes
4 answers
680 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 ...
Kaz's user avatar
  • 8,790
11 votes
2 answers
21k 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? ...
greenhoorn's user avatar
11 votes
2 answers
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) ...
Jamal's user avatar
  • 34.9k
11 votes
1 answer
435 views

A minimal version control system

I just finished writing a simple version control. You register files using "add", and then "com" will save them inside a directory, with an ID attached to it, same ID for all files. With "rev" it will ...
Simpfally's user avatar
  • 113
11 votes
1 answer
243 views

Creating an app for selecting a folder

The script creates a simple app with a GUI containing an input field and a button to select a folder. On startup a default value is set to the input field. If the user types a value or selects a ...
Pablo's user avatar
  • 95
11 votes
2 answers
171 views

Test runner for Scala problems

I'm learning Scala and could use another set of eyes on the code below. I'm creating a test runner for the 99 scala problems set. I figure between actually solving the problems and working through the ...
snerd's user avatar
  • 244
10 votes
2 answers
2k views

Filtering log files from a server

I have made a program in Python to do a filter of log files from a server. What I would like is some guidance on how this code could be optimized, streamlined or 'short-handed' so my 'pythonic' ...
CFNZ_Techie's user avatar
10 votes
1 answer
54k 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 ...
Nathan's user avatar
  • 647
10 votes
2 answers
3k views

Get directory permissions for all directories in tree

I have made a program that given a directory, will get the permissions for that directory and all sub-directories. The output is stored in a string that can be easily written to .csv. Each permissions ...
Michael Brandon Morris's user avatar
10 votes
2 answers
467 views

Minimalistic rmdir

In my eyes most of the GNU stuff is bloated and doesn't really fit my view of how a Linux environment should look like. I have come up with my own minimalist implementation of the GNU Coreutils, but ...
charly's user avatar
  • 103
10 votes
2 answers
527 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 ...
Stud's user avatar
  • 786
10 votes
2 answers
446 views

A text editor driven file renamer in Ruby

I wrote the following Ruby script several years ago and have been using it often ever since. It opens a text editor with the list of files in current directory. You can then edit the file names as ...
Aleksandr Levchuk's user avatar
10 votes
2 answers
544 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 ...
forsvarir's user avatar
  • 11.7k
10 votes
2 answers
389 views

Reading a proprietary file system and creating files

The goal of this software is to read the proprietary file system index of a digital video recorder and to carve all of the video chunks into files within a dated directory structure. I'm not very ...
DanWheeler's user avatar
10 votes
2 answers
215 views

Get Wikimedia attributions for images

We are using images from Wikimedia commons for some of Cardshifter's game artwork. I selected some art for each card to make a .jpg file to use in the game clients, ...
Phrancis's user avatar
  • 20.4k
10 votes
2 answers
22k views

Unit tests for methods that access the file system

Basically I have some methods that access the file system and to avoid that in the unit test I have broken those sections out into a protected virtual method. In the Unit Test I then use Moq to setup ...
Tyler Reid's user avatar
10 votes
1 answer
3k views

MD5 hash comparison for two folders

Using this page for a starting point into comparing MD5 hash values from files in two different folders, I've put something together that outputs either Copied if ...
user4317867's user avatar
10 votes
2 answers
795 views

Files manager API in C++

I wrote a file manager API in C++ to make the read-write operations easier in read/write cases, needing big structured data to/from multiple files. I want to get a review of the library if it's ...
Coral Kashri's user avatar
10 votes
2 answers
225 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 ...
StepTNT's user avatar
  • 385
10 votes
1 answer
244 views

Allowing user space file-system to (kind-of) keep more than maximum number of files open

The linked code below is meant to be used in a user space file-system (fuse). Given that multiple processes may have multiple files opened on the file-system, the files on the specific user space file-...
user1703394's user avatar
10 votes
1 answer
235 views

Deduplication by hard-linking files in multiple directories

About a year ago, I wrote a Python script that enumerates all the files in a directory, partitions them based on a couple of criteria (file size, a custom byte-signature of the file, hash, ...) and ...
ROpdebee's user avatar
  • 363
10 votes
2 answers
633 views

In memory data access for CSV files that may have changed

I'm reading data from CSV files and store the result in a simple DataContext instance that gets injected throughout my application. ...
Johan's user avatar
  • 631
10 votes
1 answer
1k views

Batch script to make folders hidden

I just wrote a simple script cmd to hide private folders by combining several scripts from the Internet. Can anyone give me suggestions for improvement? This batch file uses a password hidden by ...
Muthiullah's user avatar
9 votes
4 answers
4k views

DDD Architecture for an e-commerce website (uploading images)

Problem Description I am working on an e-commerce website, when a user wants to sell a product, he would open the product page and he can upload up to 12 photos: Image Upload Process This is the ...
Hooman Bahreini's user avatar
9 votes
3 answers
1k views

Adding data from multiple Excel files to two lists

I have 5 nested for loops below, to add rows of data from multiple files to one of two lists. Is there a more pythonic way of doing this? I've come across an ...
user avatar
9 votes
3 answers
389 views

Search for directories with a certain prefix that contain no files of a given type

These two functions search for directories with a certain prefix that contain no files of a given type. Does the code adhere to Ruby standards and conventions? Am I doing something the hard way or ...
wchargin's user avatar
  • 1,169
9 votes
2 answers
12k views

Find files by pattern and copy to target location

This is my solution to the Chapter 9 exercise in Automate the Boring Stuff: Selective Copy Write a program that walks through a folder tree and searches for files with a certain file extension ...
Elarbe's user avatar
  • 93

1
2 3 4 5
15