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
54 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
596 views

File System - OOP

I have added an object oriented file system. I am looking for suggestions for how I could improve it further. ...
2
votes
1answer
113 views

A Text-Based Browser using Requests, Beautiful Soup, Sys, OS, and colorama

I have worked on this for quite a long while, and this is my 3rd attempt after completely demolishing 3 other 200 liners, and i really need ideas on how to make my code add more functionality or ...
3
votes
2answers
164 views

Run directory scan as Class

I've progressed with the directory statistics function and want to proceed by making it a class. Link to the first version of this code: Link My current state of things: About my namings: I first ...
3
votes
3answers
285 views

An entire file size retriever using a recursive os function in python

I'm a beginner and i just started with automate the boring stuff with python course and reached his first os lesson, so i decided to make a recursive directory size finder since apparently os.path....
1
vote
2answers
170 views

PHP 7.3.9: Check if uploaded file is an image (I don't care about the format)

I just care if it's any of the common formats so that later when I list all files, for those that are images, I can generate previews based on mime type. So PHP.NET suggest to use ...
4
votes
1answer
134 views

Loading Files from a Directory in Haskell

I'm a very new Haskell programmer, and I've written the following code for loading TSV files. I think it can be improved, but I'm not sure how. I feel like the giant "do" block in loadData is ...
2
votes
0answers
214 views

Implementing A File and Directory Traversal Iterator in Rust

Background Traversing the file hierarchy, going through files and sub-directories from a directory, is a quite common task when doing file system search operations of some sorts. I have already ...
6
votes
2answers
693 views

In-memory filesystem

I implemented an in-memory file system that should support basic Linux commands (mkdir, cd, mkfile...) on the current working directory. It can read commands from a file and process them. I'm ...
4
votes
1answer
46 views

Moving all .xlsx files from the last five days (but not today)

My code works, but it looks very bad. I need to move .xlsx files from the previous days from one folder to another, but I should'nt move the files with today's ...
3
votes
1answer
168 views

NodeJS CLI script to create React apps

Background I crated a CLI tool which executes an npm command (to create a react app) and modifies the contents of the generated files. It was a practice attempt at ...
3
votes
1answer
245 views

Find a file in current or parent directories

As a Rust beginner, I would like to know how I could improve the following points considering the function below: Handling Path and ...
4
votes
0answers
99 views

downloading a list of urls

I wrote this quick (lots of googling) and dirty (I hope not too dirty) script to download a URL list with a win32 wget port and save them as files with the url as the name to use as a "poor man's url ...
-4
votes
1answer
76 views

Writing an object to a file; Is this approach correct? [closed]

I saw an article on how to read/write class objects from/to file in C++. The example there declared an object inside a member function and wrote the object into a file using ...
2
votes
1answer
188 views

Wrap that uses filesystem in C++

This is a wrap that queries the number of files and folder from a given directory, also list the folders and files into a vector. I have posted another wrap in this discussion that do the same things ...
2
votes
1answer
73 views

Moving files from a directory to multiple with names same as file

I have a folder containing thousands of files and directories. I would like to move all the files that are not contained in a sub directory into a directory and name it the file name, while ...
2
votes
1answer
135 views

Processing all files in directory

DO NOT RUN THIS EXAMPLE BLINDLY, IT REMOVES ALL FILES UNDER argv[1] Hello, This little programm should read all files from a given directory and do some work with them. New files are constantly ...
4
votes
2answers
1k views

Find all files that match a filename pattern in a folder tree

I am an old python newbie here, migrating from fortran77 ;) Still unsure of the python terminology at the moment :( The python3 script below fetches a large list of matching files in a folder tree, ...
9
votes
1answer
157 views

Deduplication by hard-linking files in multiple directories

About a year ago, I wrote a Python script that enumerates all the files in a directory, partitions them based on a couple of criteria (file size, a custom byte-signature of the file, hash, ...) and ...
6
votes
1answer
194 views

Changing the ACL on a folder through Wscript.Shell within VBA

I have working VBA code in excel that changes a network folders permissions. The code uses Wscript.Shell to run icacls commands but there are multiple instances of this command and each time it runs, ...
2
votes
1answer
54 views

Recursively find files of certain types and log their paths (C++)

I've written a function that takes a list of extensions and recursively finds files of those types, and logs their paths to a text file. Usage example (finding image files in a home directory): <...
5
votes
3answers
262 views

Proper way to find newest file in a directory

I wanted to ask if this is a better way to find a latest file in given directory. This is my current approach: ...
2
votes
1answer
57 views

Validate (Possible) File/Directory Path

I am working on a "comprehensive" library for use in my internal applications and I have created a working method (as far as all of my testing has shown thus far) to ensure that a file/directory path ...
1
vote
0answers
88 views

Recursively look up directories, (a little bit) slow

I wrote some Java code to look up all files in a chosen directory (like it's showing in the Windows Explorer), and to display the results, but it seems to be slow. Can you tell me, how to speed up it? ...
3
votes
0answers
45 views

Caching image thumbnail web-application based on rocket

This is my first rocket web-app. It serves images from a directory and thumbnails from a sub-directory. if no thumbnail is found for an existing image it is created on the fly. Before I launch this ...
4
votes
1answer
54 views

This program reads from serial port, Saves this to a text file, increments file name each time it is run

I want to condense it and get rid of any noob programming errors. The code works fine but I know it's not as elegant as it could be and I really want to improve. Your advice would be brilliant! I've ...
5
votes
1answer
190 views

Plain-text file encryption and decryption

I have created an Encryption and Decryption Algorithm that encrypts plain text using a given cipher and also decrypts it back to the original notation. It works great. This was my code for a coding ...
5
votes
1answer
130 views

List files and folders in current dir with special handling for tty

I want to write a custom ls command to learn rust. This is what I've done as for the version 1.0. This display files and folders in a cyan or white if it's on a ...
8
votes
4answers
2k views

DDD Architecture for an e-commerce website (uploading images)

Problem Description I am working on an e-commerce website, when a user wants to sell a product, he would open the product page and he can upload up to 12 photos: Image Upload Process This is the ...
2
votes
3answers
49 views

Write directory new entries to file periodically, keeping the ones that existed in the past

Some backup Bash script on my machine copies a specific directory entries filenames into a text file. Entries that no longer exist have to be kept (entries added during a previous run). The script ...
1
vote
0answers
39 views

Photo rename by Exif date and group into folders with a threshold

I wrote this tiny F# project yesterday, but I am a bit rusty and I would like to know if there is anything I can refactor and make more elegant. ...
5
votes
1answer
66 views

Interactive folder files organizer (Alpha-numeric and type) for macOS / Linux in Python

A simple interactive Python script for organizing messy folders on the computer, supports macOS and linux but not windows. The mini-program has the following features: Creation of Alpha-numeric (A-Z /...
2
votes
1answer
391 views

Go functions to create a directory if it doesn't exist

Which of the 2 solutions is written better? Personally I prefer the one line method but it does make it slightly more difficult to debug. Is perhaps doing it the long way first then refactoring to ...
3
votes
0answers
52 views

Adapter pattern to support multiple file storage systems

I am just getting in to following design patterns. I have create a class that allows for performing a couple operations on different remote storage systems: drive, dropbox, .etc (I call these ...
2
votes
0answers
88 views

Implementing an efficient async FileSystem class based on libuv in C++

I currently am working on a game engine written in C++ with libuv backed for io system calls. I have a FileSystem class that just 'works'. I am allow to read files without blocking but the current ...
2
votes
0answers
40 views

Bulk File Rename; Improved Safety and Performance

A function that funnels all filenames into a file and opens that file in vim. The user then changes the names, saves, and quits. Finally the function renames the files in the folder with the new names ...
6
votes
1answer
127 views

Delete all virus-affected files with certain filenames

Purpose of the code is to delete all virus affected files from your pc. ...
2
votes
0answers
70 views

Minimal Static Site generator

For my first project with Rust, I decided to try and implement a minimal static site generator. I've never had any code review, and I've been looking for some feedback so I can get better! Brief ...
3
votes
2answers
80 views

Reading image files asynchronously and displaying them on the page

I am trying to display images from a folder in my project using the "fs" module with NodeJS. I need to read all images in a directory and run them in a loop for them to be displayed. I was able to do ...
14
votes
1answer
427 views

Loading a file from a FAT32 filesystem in 16 bit real mode on x86 (Intel syntax assembly)

I am writing a bootloader that needs to load a file from a FAT32 filesytem. Since I need to load both the root directory first to find the start of the file, and then the actual file, I wrote a ...
3
votes
0answers
121 views

SHA256 directory hash

I'm pretty new and I posted on SO earlier because I wanted to make sure my code was right and all that and I got redirected here. So I have this code that I put together (using Example C Program: ...
5
votes
1answer
298 views

Python script to rename images based on descriptions in a text file

I like to collect images for my desktop background, but the problem is sometimes the image names don't represent what the image is. I decided to write a script that reads a text file that contains the ...
4
votes
1answer
2k views

Creating a file of md5 hashes for all files in a directory in PowerShell

I have been trying to write the md5 hashes for all files in a directory and its subdirectories to a file. Ideally, replicating the output of the Unix command ...
3
votes
3answers
1k views

Go function to test whether a file exists [closed]

How could one write in a more elegant way that if error is null, the result is true? I really need a bool as returned value. ...
6
votes
3answers
129 views

File duplicate finder

In an attempt to clean out my picture collection I made a script to find all duplicate files ...
10
votes
2answers
237 views

Files manager API in C++

I wrote a file manager API in C++ to make the read-write operations easier in read/write cases, needing big structured data to/from multiple files. I want to get a review of the library if it's ...
5
votes
2answers
145 views

Program to delete directories that do not contain a file

I'm an intern and have an ETL project I'm doing in python. Part of it is to make sure after I move files I delete empty directories. I wrote this code to clean up directories that are empty and in ...
6
votes
1answer
186 views

EEPROM-based filesystem, aiming for Misra C++ 2008 compliance

I'm writing code for embedded systems (IAR compiler) and it should adhere to Misra C++ 2008. This limits the available features of the language quite a bit: no C++1x features use of the standard ...
3
votes
1answer
142 views

Deduping files using hardlinks

I'm trying to organize my gallery, and I have certain folders rife with copies. My daily work is mostly javascript and php, being your generic web developer. However I took this as an opportunity to ...
5
votes
1answer
133 views

Sandbox file system for Java

I've recently started work on a hobby project that's basically a sandbox file system written in Java, slightly inspired by PhysicsFS. The point of the project is to separate what files a user can read/...

1
2
3 4 5
14