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
5 votes
1 answer
457 views

C++ - Find all duplicate files (follow-up)

What's changed since the first version: Instead of hashing each and every file, the sizes of the files are first compared, and if those are equal, the files are then hashed. A more collision resistant ...
Harith's user avatar
  • 5,669
3 votes
1 answer
269 views

C++ - Find all duplicate files

It requires no explanation, so here's the code. Code: ...
Harith's user avatar
  • 5,669
8 votes
4 answers
965 views

Remove all text files with non-US-ASCII text encoding from current folder on Linux

...
FAQ's user avatar
  • 183
9 votes
3 answers
234 views

Java code to delete all empty folders within a directory

Given the path to a filesystem directory, the task is to delete all empty directories within that root directory. After the process is finished, no empty dir should exist under the root directory (the ...
user avatar
5 votes
0 answers
177 views

Resolve an entire NTFS Master File Table's worth of File Records to Absolute Paths

This is related to my previous question. This is it, the full working code that resolves all file record segments in a Master File Table to absolute file paths. It is completely working and seems to ...
Ξένη Γήινος's user avatar
1 vote
1 answer
102 views

Looking for help simplifying a general purpose compression function

The following is a general purpose file compression function with the following features: It can take either a single file or directory as the source input It defaults to the source directory when to ...
Christian Fitzner's user avatar
2 votes
1 answer
187 views

NTFS Master File Table Parser

I have written a Python program to parse the Master File Table located by //?/X:/$MFT. Of course trying to open it normally will result in ...
Ξένη Γήινος's user avatar
3 votes
1 answer
44 views

Check if options are valid to create FAT12 image

This is a function that checks if a valid FAT12 image would be created. Since all the information to create it is available on the "boot sector", this is the parameter. I wanted the code to ...
Schilive's user avatar
  • 243
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
5 votes
2 answers
297 views

Binary file reader and writer

I want to write a simple binary file reader and writer class. The class below can read or write file. main.cpp read 500 bytes from tmp.bin and copy at the end of ...
unique's user avatar
  • 153
1 vote
1 answer
237 views

Simple text file encryption and decryption

Short introduction; recently I've completed a basic course on C but other than that I have no programming experience and I am a total beginner. As a practice project and to practice reading from and ...
Reslashd's user avatar
4 votes
2 answers
375 views

Class for locking shared disk directory

I'm writing an application to sync files between two directories. In order to prevent simultaneous access to the shared directory from several computers, I implemented blocking of the shared directory....
Andrey Epifantsev's user avatar
2 votes
2 answers
186 views

Python script to categorize download folder based on files

My Download habit is notorious and my download folder end up piled up with random downloads, I created a python script to maintain my download folder in windows upon running the script it moves files ...
SHANTNU CHAUBEY's user avatar
5 votes
3 answers
785 views

Implementation of recursive `ls` utility

Recently I wrote my own implementation of a utility for recursive output of the directories' contents, kind of similar to the ls Linux utility with the ...
andylvua's user avatar
  • 215
1 vote
1 answer
588 views

Recursively create a TreeView for file paths using C# and WPF

I'm building a program that allows the user to monitor files on their local system. To display the files, I created a TreeView using ...
Ramza's user avatar
  • 171
6 votes
3 answers
145 views

Idiomatic and performant file hashing

I've written a small program that will accept a directory path and recursively calculate the MD5 hash of each file. ...
etchesketch's user avatar
6 votes
2 answers
231 views

ds - A directory switcher via tags in Windows command line

I have this repository. The idea is that there is a file tags sitting in the users home directory, and which contains the tag declarations of the format ...
coderodde's user avatar
  • 28.2k
1 vote
2 answers
165 views

PDF invoices from user input

Firstly the goal of this code is a little more complex than in this post and the other invoice questions are C# Is there anything that just pops out as immeadiately unpythonic/wrong ? I have a few ...
Lozminda's user avatar
  • 101
4 votes
1 answer
140 views

System Utility to Create Random Files

The following program makes random files. By default, they are of the form /tmp/rfile-XXX. Certain options allow for the user to specify where these files are ...
Jordan's user avatar
  • 79
2 votes
1 answer
140 views

php tmpdir() alternative to tmpfile()

tmpfile() creates a temporary file which is automatically deleted when php exit. I wanted the same for directories, came up with: ...
hanshenrik's user avatar
1 vote
1 answer
62 views

Class handling file conversion and data manipulation archiving [h5py]

I am a physics PhD student who co-developped a python package for file conversion of standard file format used in Scanning Probe Microscopy (SPM) and archiving of data manipulation for tracability. If ...
CoilM's user avatar
  • 13
0 votes
2 answers
60 views

Checking which programs are used for scripting

I have a directory where there are some script files, some binary files, and some subdirectories. I have tried to write a program which gets names of all files in directory, and excludes if they are ...
rnso's user avatar
  • 241
1 vote
1 answer
177 views

Version 2 of my Python Password Manager

I am still just starting out with python and just finished learning about classes, with no further understanding on many python modules. With this in mind, this is one of the biggest/hardest things I ...
Beginner's user avatar
  • 189
1 vote
1 answer
233 views

Collecting hashes of all files in a folder and its subfolders into a dictionary in Python

What I am doing here is iterating through all the files in the parentFolder and its subfolders collecting all the hashes of all the files and putting them into a ...
lungimiranza's user avatar
1 vote
2 answers
130 views

Display free disk space

With Kubuntu 22.04 ... Questions : What is a better way than using 2 cases? The 1st case, script Line 48 "case $x in" lets user choose to clear screen or not clear. The 2nd case, script ...
joseph22's user avatar
  • 159
6 votes
1 answer
723 views

Python File Transfer Script

I'm still pretty new at Python and working on a small database program, where at the start of the program new files are imported from another folder (approx. 2000), and older files are backed up. ...
Jan van Wijk's user avatar
8 votes
2 answers
413 views

Tar implementation

I am writing a tar implementation for education purposes and I started with reading from a tar file and printing the file content. I use recursion for getting the next tar header and googled "...
mortytheshorty's user avatar
4 votes
1 answer
274 views

Minimalist Recursive File Watcher (MacOS & Linux)

Looking for feedback, bugs, performance reports, and general code review of this simple file-watcher. Basic algorithm: The MacOS version just sets the relevant paths to be watched from the CLI ...
Jonathan's user avatar
  • 141
3 votes
1 answer
57 views

Wipe a directory tree

The idea here is to destroy the data in a directory tree by finding any files in it and overwriting their data with garbage before deleting them. The function returns minus the number of errors ...
CPlus's user avatar
  • 928
1 vote
2 answers
866 views

Geting file-names from the current working directory

The following routine returns the file-names from the current working directory: ...
user366312's user avatar
1 vote
1 answer
225 views

Delete files with specific filename pattern in directory with all extension using python

Preamble The first following code explains the context. ...
simone100's user avatar
5 votes
5 answers
572 views

Find the 10 largest files in a directory tree

I've recently finished a small project intended to better understand C. The program will output the ten largest files found (recursively in the event of subdirectories) in a specified directory. I've ...
John Harrington's user avatar
2 votes
1 answer
136 views

Implementing Linux style file name wild cards on Windows 10 PowerShell

Implementing Linux style file name wild cards on Windows 10 PowerShell While implementing an objected oriented wc on Windows 10 in visual studio C++ I implemented a recursive file search with a weak ...
pacmaninbw's user avatar
  • 23.8k
2 votes
1 answer
189 views

PHP Bootstrap Autoloader

I wrote an PHP Autoloader to include it "easyer" to my projects. Here the folder structure: ...
NvrKill's user avatar
  • 193
4 votes
2 answers
1k views

Clean up directories and files when a unit test fails

While running unit tests (most of them integration tests) with Python I create some directories. They need to be deleted after the test or when the test fails. The execution of the cleanup code need ...
buhtz's user avatar
  • 209
5 votes
2 answers
578 views

Automate the Boring Stuff Chapter 10 - Selective Copy by file extension

The project outline: Write a program that walks through a folder tree and searches for files with a certain file extension (such as .pdf or .jpg). Copy these files from whatever location they are in ...
Javana's user avatar
  • 451
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
4 votes
2 answers
310 views

Attempting an OOP approach for PDF Paranoia - Automate the Boring Stuff CH 15

This exercise is called PDF Paranoia and it comes from CH 15 of the book Automate the Boring Stuff With Python - second edition. There are two parts to the exercise, which I've separated into two ...
Ramza's user avatar
  • 171
1 vote
1 answer
271 views

File Abstraction Library

This library is a layer of abstraction over file operations in C#. It aims to provide easy file IO syntax, and implicit error handling behaviors, to ensure robustness in scenarios including, but not ...
Divan's user avatar
  • 113
2 votes
2 answers
107 views

Finding files using multiple coroutines

I'm trying to write a simple program to find a certain file name within a directory tree. I use up to 30 coroutines. Is there anything wrong with this code or what needs to be improved? ...
woxihuanxiayua's user avatar
3 votes
1 answer
987 views

Faster way to find duplicates in a directory using Python

This is my first Python project in file management. It's a finished and passed exercise from JetBrains (Duplicate File Handler). The main job is reading a full path to folder from argument, list files ...
Kostas's user avatar
  • 33
2 votes
1 answer
80 views

A Clojure program to classify files based on their filename

My first ever lines of Clojure and while the script seems to work as expected, I'm sure it's far from idiomatic Clojure. Thank you for any suggestions. ...
Dušan Rychnovský's user avatar
4 votes
2 answers
173 views

Python script for removing files in folders

I've been learning python for some time and I've come up with the idea to practice it a little. I created a script that removes files by their extension .html and .srt and also empty directories. It ...
Roy O'Bannon's user avatar
4 votes
0 answers
96 views

Determine when a file is no longer being changed by hashing

I have a requirement to essentially scan a filesystem on any kind of filesystem and move a resource whenever it is ready. To do this I have the following code ...
Patrick Christie's user avatar
4 votes
1 answer
99 views

Mount point API for Linux systems

I have a use case where I need to check, whether / is mounted read-only. Here's the module where I implemented this check: ...
Richard Neumann's user avatar
1 vote
1 answer
298 views

I have written a method to write any string in file. Should I close file or not

I have written this code to write string to file. If File is not created then create file and If created append to same file. File is created daywise. ...
Sup Ravi Kumar's user avatar
3 votes
1 answer
64 views

Open a file, by looking in an ordered list of directories (search path)

I have a small Python application that needs to load a few different files (templates and config files). It should look in a number of destinations, in the following order, and load the file from the ...
Mads Skjern's user avatar
2 votes
0 answers
93 views

Rust Undertale Save File Loader

This code's job is to load save files from a subfolder in ~/undertale-saves and save them to ~/.config/UNDERTALE_linux_steamver. ...
Tornado547's user avatar
2 votes
1 answer
134 views

Changing the attributes of a file

I wrote a program that changes the attributes of a file. How can I make the program more efficient? Please find program problems. How can I improve the program? ...
Dave's user avatar
  • 51
1 vote
1 answer
572 views

Thread in a Spring app that watches a directory for new files

Before showing-off the code, here is a bit of an explanation. I have a Spring component that spawns a thread for watching a directory for new files. In this context, I have a method that runs in a ...
usr-local-ΕΨΗΕΛΩΝ's user avatar

1
2 3 4 5
15