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
3answers
62 views
+200

A file system watcher class for on-fly file reloading when it has been modified

I wrote a file sytem watcher class that is used to monitor file modification and then execute user-defined handler. Other file system events like moving or deleting don't need to be monitored. The ...
5
votes
2answers
51 views

Count *.plot files in certain directories on network filesystems

First of all, I am playing around with python for about a week tops. Absolute beginner here. My story: I work as an IT administrator so I am familiar with eg. PS on a very basic level. I actually got ...
1
vote
3answers
116 views

Basic Linux filesystem commands

I'm learning the file system library and thought nothing could be better than a project, so I thought of recreating the basic Linux commands such as ls, ...
4
votes
2answers
115 views

Efficiently write in a file in C++

I've made a program which reads from the console and writes it in a .txt file. This programm should write in a file with \n. <...
0
votes
0answers
23 views

List sub-folders and its ID in the given path in Google Drive with Google App Script

I am trying to create a doc file which contains the list of folders in a given folder path. The Main function is the entry point. ...
0
votes
0answers
17 views

Powershell Refolder by Filename Before Delim

I'm pretty new to Powershell but have been using it more and more to automate tasks at work. Now I'm reaching out for some help. I typically use the scripts I write in a way where I copy and paste the ...
0
votes
1answer
146 views

Retrieve filename and ID with Google Drive API in C#

I am trying to retrieve filename and ID list with Google Drive API (the latest Drive API version v3 is used here) as a first step in order to analyze and manipulate these files on Google Drive. The ...
2
votes
1answer
26 views

C code to reset all usb devices (because ubuntu laptop disables usb mouse after sleep)

I don't program much in c, but cobbled together some code from different places in google. I'm sure this is backwards especially in how it works with strings and directory files. Please let me know ...
3
votes
0answers
41 views

Python script that getting list of all files with specific ext starting from the current folder. Using timer for reporting about the process

I am using a function that returns a list of all files (full path for each of them) with the given extension in the given folder and all subfolders. As the process is quite long and user can get ...
2
votes
1answer
60 views

Traverse directory using multithreading

I have written program which following purpose Traverse directory in multi threading environment First determine all top level directory and store into vector which have following result: /home/dir1 ...
3
votes
0answers
16 views

Detecting Dependencies in Common Lisp Project Files (Part 2)

This is a rewrite of the Dependencies program submitted previously at https://codereview.stackexchange.com/questions/255635/detecting-dependencies-in-common-lisp-project-files/256336?noredirect=1#...
1
vote
0answers
15 views

Swap a symbolic link with its target

This program takes a symbolic link as argument, and swaps the link with its referent. For example, given a -> b, the result will be ...
2
votes
1answer
46 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. ...
3
votes
2answers
71 views

Simplifying small watermark application

I recently started out with C++ and I am working on an application that can watermark entire directories of images at once. Currently you can call the program with an argument of the target directory ...
1
vote
0answers
82 views

Performance in find and replace String program java [closed]

I have a Java program that does find and replace (like when you do it in a text editor for example notepad++) in files of a folder and all sub-folders. I created 4 functions: the first function has ...
3
votes
1answer
38 views

Simple file-renaming program in python

I’m learning python and have built a very simple program that just renames files. It makes all letters lowercase and replaces spaces and %20-instances with ...
5
votes
2answers
274 views

Directory size checker

So I semi-wrote directory size checker by copying some parts from Stackoverflow. It works as follows: Select a directory you want to check the size of subdirectories inside. It goes scans all the ...
4
votes
1answer
184 views

PowerShell - fast remove a directory with 10,000+ files

I am sick of File Explorer's super slow deletion speed, so I tried to write a PowerShell script to make deletion faster, and while it does its job, its speed isn't as high as what I intended it to be. ...
5
votes
3answers
80 views

Python - First project user system

This code is supposed to be the "user" system for my app. This will ask you what you want to do... If you want to add a user, remove a user or check the list of saved users. With this I ...
4
votes
2answers
94 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: ...
4
votes
2answers
64 views

File mover based on document name

I wrote a script that places documents to the folders they should be (based on my preferences of course). It even creates the folder if it doesn't exists. Here's how it works: You run de script by ...
5
votes
1answer
72 views

Watchdog to monitor a folder

I am creating a watchdog in python to monitor a folder and then create a backup with the new version when a file is modified. I extend the FileSystsemEventHandler class to add 7 extra variables. ...
3
votes
1answer
31 views

Clean up directory and file artifacts

I have some directories with artifacts in them, and I want to clean them up by deleting them. The requirements are: Keep the 3 most recent directories Keep only one snapshot folder Keep only one rc ...
1
vote
0answers
96 views

Generate many, many folders fast

I've made a program which makes the folders a-z, and in each of those makes the folders a-z, and in each of... you get it. many, many folders. its quite slow at the moment, would there be any way to ...
2
votes
0answers
27 views

Uploading CV file to an e-commerce website and sending the CV to employer's email

I am working on an e-commerce website. In this specific scenario, people can upload their CV to apply for a job. The job application is sent to ApplyForJob action ...
6
votes
2answers
1k views

A utility to swap two files

While I have never had to swap two files I have always wondered if there was command for swapping two files and recently I decided to see if there was one. Eventually I found out that there wasn't one ...
2
votes
1answer
56 views

Linked List implementation of FileSystem directories

I am writing wrapper classes in Java which override methods of an existing implementation, in order to handle an edge case. The full implementation is a bit more complex than needs to be posted here, ...
5
votes
1answer
76 views

build multiple websites with yarn

This is a Bash script that runs commands which builds code using the parameters given. Code The task: I have multiple instances of websites which need to be build individually using individual yarn ...
4
votes
2answers
737 views

In-Memory FileSystem in Java - Is there a better OOP approach?

I have implemented an in-memory filesystem - this is a design question from LeetCode. Is there a better OOP approach to represent files and directories? The current code uses a boolean flag ...
4
votes
0answers
117 views

Tar file utility - Rust

I've been working on building a Rust version of GNU tar following the spec here. As of right now, I've got the binary accepting a single argument, the path to the file/directory to tar, which is ...
2
votes
0answers
83 views

No hardcoded path

Since i develop in Java, i got into the habit of not putting hardcoded text in my code. For paths to files and folders I use the code below. I did it in a way that it was easy to set up and quick to ...
5
votes
1answer
249 views

Fishy password management

Problem When it comes to security I like to don a tin foil hat. As such I use the, off-line password manager, Keepass. Keepass allows you to to use multi-factor authentication via; a password, a ...
1
vote
3answers
123 views

amino acid data prediction

I want to preface this by saying I didn't quite know where to put this because this isn't quite a stack overflow question. So if this is the wrong place to post, please let me know, and please let me ...
2
votes
1answer
20 views

Checking hierarchical config files for hashed id and informing the user of changes

Our testing suite is configured using a type of hierarchical config file similar to .ini or .toml files. Each 'block' is a test ...
7
votes
1answer
409 views

Folder Syncer in Python

I have made a script that syncs one folder to another. So if, for example, you saved some changes in a file in directory A, then that file would have the same ...
4
votes
1answer
75 views

Writing with too many system calls

I have a writeOnFile() method with too many fwrite(). I think it is not a good implementation because too many system calls may ...
1
vote
1answer
83 views

What is the fastest way to record the listed files in a directory in C?

I want to fill an array of dirent pointers with each entry of a specified directory. I either need to count the items before, allocate memory, then go over them ...
3
votes
2answers
55 views

What is the fastest way to record the names of each file in a directory?

I want to fill an array of strings with the name of each directory item. The issue is allocating memory. I either need to count the items before, allocate memory, then go over them again, or I will ...
3
votes
1answer
281 views

Recursive os.scandir() for copying/moving files preserving subdirectories

This is modified from the general recursive solution here: https://stackoverflow.com/a/54544211/42346 to, more specifically, copy/move files with a given extension from one directory to another whilst ...
3
votes
1answer
42 views

Write Excel range containing names to .pcs script file for PABX programming

I'm a newbie PABX tech with a hobby for programming so when I learnt most of the telephone system programming can be completed with scripts I got curious. With a bit of trial and error to work out ...
3
votes
1answer
38 views

Compare 2 directories for equality

Currently, I'm working on a legacy application written in .NET that does not contain any unit tests. This application, when executed produces a very large directory tree with roughly 20.000 files in ...
4
votes
0answers
66 views

C program to sort files based on information within

I have written a C program to sort files (on Windows) into dynamically created subfolders based on information found in their data headers. I am a newb at C, especially memory management. The code ...
1
vote
1answer
86 views

Simulating a Rock, Paper, Scissors Game - Flexible

Today I learnt the basics of OOP. I have tried to apply them to this Rock-Paper-Scissors project. However I'm still a beginner, and so I feel my code can be improved. Are there any tips, trick or ...
4
votes
1answer
132 views

Webscraping With Selenium - a Course Downloader and Sorter

I've been working on a program that automates the painful task of downloading each file from a website for courses one by one and sorting them using python. This is my first python webscraping project ...
1
vote
0answers
39 views

File organizer based on extensions

I'm still new to programming and I'm not confident about this code. I recently created this File Organizer that organizes files in folders based on their extensions. How can I make this code cleaner? ...
2
votes
2answers
415 views

Resolving Paths relative to script file, independent of calling location

Idea Consider the following snippet: ...
3
votes
1answer
188 views

List and filter files in Rust

I'm learning Rust and looking for better/cleaner ways to list all file names that do not start with filter, given a pathname as ...
4
votes
1answer
642 views

Random temp folder implementation for unit testing

I faced a series of problems when unit testing a tool of mine that generates files. They were caused by me putting the files in the same temporary folder and the tests running in parrallel. Here is ...
1
vote
1answer
53 views

FileSystem Utilities wrapper

Related to my code I just put out for review. I wrote some small helper functions for dealing with interactions with the file system. This is not meant to by any type of "File System" wrapper. I just ...
3
votes
3answers
502 views

File System - OOP

I have added an object oriented file system. I am looking for suggestions for how I could improve it further. ...

1
2 3 4 5
13