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

Read file from current path in Python

I had to write a custom function to load a yaml file from the current working directory. The function itself works and my intention was to write it in a pure fashion but my senior colleague told me ...
1
vote
2answers
92 views

Moving files according to paths in database

I'm trying to move a large number of files. I get the path of source and destination from database. It takes hours to move images, and I was wondering if there is a faster way for moving large ...
4
votes
1answer
102 views

Code to scan filesystem, store every path into sqlite and update only when something has changed

I have made a program that does what the title explains. It also hashes the file to check for changes. I will be doing this for a project to keep track of files that has been changed when doing ...
5
votes
1answer
183 views

Optimized way to save list of files

I would like to optimize the way that I save files. Each second I save lots of strings in different files. What I want to do is bunch up these IO tasks so they happen in bursts, instead of spread out ...
0
votes
2answers
80 views

Combining iterrows of pandas with os.walk given I have a lot of directories

I have the following code snippet: ...
3
votes
1answer
32 views

Delphi function to canonicalize the capitalization in a file path

I'm building a small Delphi application where a user can input a file or directory manually by typing it or by selecting it from a dialog . Since it can be input manually, I want to ensure that I save ...
0
votes
1answer
76 views

Efficient way to construct list of sub-subdirectories in python

I have a directory that includes a number of subdirectories. Each subdirectories contains subdirectories of its own. I'd like to construct a list of all sub-subdirectories in python. Here is my ...
1
vote
1answer
22 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
62 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
1k 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
79 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
46 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
829 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
92 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
61 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
138 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
130 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
31 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. ...
1
vote
0answers
27 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
415 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
29 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
47 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
128 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
20 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
17 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
58 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
73 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
126 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
40 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
280 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
522 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
85 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
168 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
66 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 ...
4
votes
1answer
88 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
38 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
31 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
91 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
96 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
1k 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
138 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
91 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
271 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
24 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
483 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
102 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 ...

1
2 3 4 5
14