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
0
votes
0answers
56 views

Finding the first null character in a file, if I am going to save everything before it in a malloc() block? [closed]

I need to know which is a better option, provided they both work as intended. I need to open a file, and load everything up to the first null character into a ...
2
votes
0answers
25 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
38 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
57 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
87 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
72 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
69 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
205 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
122 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
19 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
332 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
68 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
74 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
54 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
54 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
40 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
34 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
62 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
66 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
95 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
37 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
86 views

Resolving Paths relative to script file, independent of calling location

Idea Consider the following snippet: ...
3
votes
1answer
58 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
276 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
41 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
112 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
65 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
155 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
126 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
53 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
44 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
94 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
263 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
40 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
134 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
80 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 ...
3
votes
0answers
87 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 ...
0
votes
0answers
57 views

Make a Map<?,?> containing configurations based on file system principles

I am working on a Java project that currently depends on 500+ configuration files in the form of XML, XSLT and YML files. The vast majority (~400) are XSLT files, and the purpose of the application is ...
-4
votes
1answer
73 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
92 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
60 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
60 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 ...
3
votes
2answers
270 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, ...
8
votes
1answer
130 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
93 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
49 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
133 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
53 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
49 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? ...

1
2 3 4 5
13