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
1answer
17 views

Batch generating histograms of images in Matlab

I am attempting to plot histograms for batch of images in Matlab. The file structure of input images and the experimental implementation are listed as below. File structure of input images The matlab ...
2
votes
2answers
59 views

Send an array of files and return the first one that exists

I have a little project, chuy, which is basically a copy of Make. By request of users I have added support for toml configuration, since originally it only accepted ...
4
votes
2answers
963 views

CSV file reader

Hi, I asked this question over on stack overflow. However, they closed the thread and suggested to ask it on code review. So here I am :) The code below is an updated version of my original code, ...
1
vote
1answer
74 views

Replacing a char in the file name

I am formatting my TV series archive and can not do one by one. I wrote this code and it's working like what I want. I am a beginner and want to improve my knowledge of algorithm. What can you ...
1
vote
1answer
45 views

Move all markdown files from one folder to another in Python

I want to move all markdown (.md) files from one folder to another. The folder structure I have: ...
7
votes
2answers
525 views

C delete files and directories, recursively if directory

This is my function that uses recursion to recursively delete a directory. I like my way of skipping entries . and ... But ...
2
votes
3answers
87 views

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
58 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
127 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
122 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
27 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
22 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
258 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
43 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
75 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
18 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
51 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
107 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
39 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
275 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
308 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
81 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
122 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
74 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
32 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 ...
3
votes
2answers
83 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
88 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
957 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
125 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
89 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
261 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
23 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
422 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
76 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
89 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
354 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
43 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
42 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
67 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
94 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
156 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
2 3 4 5
14