Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

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
2 votes
1 answer
31 views

Finding the Size of a File in a Portable Manner (revision 2)

This is a follow up to Find the Size of a File in a Portable Manner (revision). Changes made: The return value of fseek() and ...
Harith's user avatar
  • 6,720
4 votes
2 answers
68 views

Find the Size of a File in a Portable Manner (revision)

This is a follow up to Find the Size of a File in a Portable Manner. What's new: The fast version (POSIX stat()) does not change the position indicator of the ...
Harith's user avatar
  • 6,720
4 votes
1 answer
168 views

Find the Size of a File in a Portable Manner

There's no function in the Standard C Library to determine the size of a file. The POSIX Standard has stat()/fstat() which are ...
Harith's user avatar
  • 6,720
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
5 votes
1 answer
493 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
  • 6,720
3 votes
1 answer
295 views

C++ - Find all duplicate files

It requires no explanation, so here's the code. Code: ...
Harith's user avatar
  • 6,720
8 votes
4 answers
974 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
275 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
181 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
103 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
212 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
46 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
346 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
270 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
380 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
194 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
795 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
663 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
147 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.4k
1 vote
2 answers
177 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
143 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
65 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
184 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
249 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
750 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
444 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
276 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
960 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
238 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
574 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
144 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
198 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
2k 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
585 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
318 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
284 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
108 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
1k 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
175 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
106 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
315 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

1
2 3 4 5
15