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
1 vote
1 answer
55 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
  • 169
6 votes
3 answers
122 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
223 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
  • 27k
1 vote
2 answers
106 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
4 votes
1 answer
129 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
112 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
58 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
59 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
  • 266
1 vote
1 answer
107 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
168 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
121 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
6 votes
1 answer
606 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
260 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
161 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
54 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 ...
user16217248's user avatar
1 vote
2 answers
352 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
0 votes
0 answers
90 views

Archive files in a folder by year

I created a code to archive files in a folder by year. It writes subs of the root folder into an array, then writes the sub of those subs into an array, runs through each folder and then archives the ...
FrancoisB's user avatar
1 vote
1 answer
88 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
550 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
84 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
2 votes
1 answer
122 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
926 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
518 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
0 votes
0 answers
28 views

Remake fs path() in pure R

My first post here, where I would like to create a function similar to path() in fs package. fs is based on the external C library libuv, but I need path() in ...
antonio's user avatar
  • 101
15 votes
4 answers
1k 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
283 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
  • 169
1 vote
1 answer
184 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
94 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
681 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
71 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
159 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
58 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
187 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
56 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
87 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
71 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
384 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
3 votes
1 answer
437 views

Automate the Boring Stuff CH 10 - filling in the gaps

This exercise comes from Automate the Boring Stuff CH 10 - second edition. The exercise is called "filling in the gaps," and the instructions are as follows: Write a program that finds all ...
Ramza's user avatar
  • 169
3 votes
2 answers
49 views

Single-file stdlib-only python backup utility

I have written this backup utility to keep incremental backups by copying new and modified files, and hard linking unchanged or simply moved files. In an attempt to speed up the comparisons, I save a ...
Aaron's user avatar
  • 233
3 votes
2 answers
103 views

change file attributes on a Linux file system with chattr

I am reading the book The Linux Programming Interface and I have reached the exercise in which the implementation of the chattr command in C is required. I would ...
Dave's user avatar
  • 51
2 votes
1 answer
63 views

UPDATE #1: Lengthening the time it takes to access files using function hooking

https://github.com/speedrun-program/load_extender This is the previous post: Lengthening the time it takes to access files using function hooking I tried adding everything from the previous post's ...
my_stack_exchange_account's user avatar
3 votes
0 answers
65 views

Organize files based on inputted keyword

My code basically organizes the files in a given directory based on the keyword inputted by the user, so for example if there is a directory with three files: ...
Rohith Nambiar's user avatar
2 votes
1 answer
62 views

Lengthening the time it takes to access files using function hooking

https://github.com/speedrun-program/load_extender This is something I made and posted here about a year ago, but I decided to remake it. To compile this on Windows, you need to install EasyHook. ...
my_stack_exchange_account's user avatar
4 votes
2 answers
414 views

Recursive function designed to ensure that full folder path exists before copying a file to the location

My recursive function works, but I feel it could be improved... suggestions? The code ensures that a given folder path exists by checking its validity or creating them if they don't already exist, so ...
rohrl77's user avatar
  • 181
1 vote
1 answer
77 views

Get files from disk filtering by size

does anyone knows how I can simplify this code? The objective is to get multiple files from the explorer and validate the number of files, the weight of each file and the total weight. ...
davidsi02's user avatar
  • 229
2 votes
1 answer
187 views

implementation of the `mkdir` command with `-p` parameter in C

I wrote a program that implements the mkdir command with the -p parameter to create the parent directly if it does not exist. My ...
Mark's user avatar
  • 449
2 votes
1 answer
73 views

Safely renaming/moving files in Node (cross platform)

My goal is to create a function that safely renames files by adding numeric increments if the file is found at the destination, without using a third party library. Having a source file ...
Bill Kervaski's user avatar
1 vote
1 answer
115 views

Open, read/write, then close a relative path

These functions will open a relative path, read or write to the file, then close. The purpose of these functions is to avoid duplicate code patters for accessing different files that only require one ...
user avatar
1 vote
1 answer
93 views

PHP autoloader that uses array of file paths

After doing much reading of the PHP docs and trying out other developers' autoloader code, below is what I've come up with for an autoloader. It is working as expected so far. Posting the code here ...
knot22's user avatar
  • 357

1
2 3 4 5
14