Use this tag for reviews of code that performs file system operations, such as creating, deleting, renaming, moving, copying, reading, and writing files.
3
votes
0answers
29 views
Get process max memory usage while copying large data
I want to check the memory usage of a process before and after I copy a large file or folder, and also, I want to get the maximum memory usage during file operation. Is this a good method?
...
2
votes
2answers
251 views
Processing lots of JSON objects
I want to process a ton of JSON objects as quickly as possible.
I've done my best to make the processing as concise and efficient as I can.
How can I make it more efficient?
...
-1
votes
1answer
59 views
Directory Filter Class PHP
I'd like feedback on the class below, from the perspective of wanting to write professional code that I would be paid to create. I would appreciate comments on details such as commenting, naming and ...
1
vote
1answer
60 views
Recursively list files within a directory
I have the following code to recursively list files within a directory:
...
0
votes
0answers
40 views
Open and read a large number of files from folder [duplicate]
Is this the fastest way to open a large number of files and read their contents? (The folder may contain lakhs of files.)
...
5
votes
4answers
418 views
Initialization File Parser
For my game I decided to incorporate .ini Initialization Files to store game data. Items like: Weapons, Armor, Potions, Enemies, Actors, Loot Drops, and so much more. All of these things can be easily ...
-1
votes
1answer
98 views
3
votes
2answers
58 views
Bash script to rename subfolder to include name of parent folder
Here's the current structure of my directory.
.
├── Show 1
│ ├── Season 1
│ └── Season 2
├── Show 2
├── Season 1
└── Season 2
I want to rename the ...
0
votes
1answer
28 views
Getting startup folders
There are 2 versions of the get_startup_folders() method below, both work as expected and are called only once.
The 1st version has several minor pieces of ...
1
vote
1answer
36 views
Find and copy .tiff files
My code works as expected but I am not sure how to optimize the code. The purpose of the code is to find files with given parameters and copy them to a separate folder.
...
0
votes
0answers
38 views
Script to run “npm install” for all directories/subdirectories that have a package.json file
So to give some context:
I have a relatively large repo with package.json files scattered across it for a bunch of unrelated projects.
I just needed a quick script ...
1
vote
1answer
141 views
Recursive autoloader to find PHP files
I created a small working autoloader based on some of the answers and ideas found on Stack Exchange (I lost the reference). However, I don't know much about PHP (I mainly know C, a bit C++ and Java). ...
2
votes
1answer
58 views
C++ Dirent.h “Wrapper”
I do not want to call this a wrapper, but no other name comes to mind right now, so I'll use it incorrectly for the rest of the question - It's just a class that adds C++ functions to ...
-3
votes
1answer
64 views
Directory listing in a web server
I have Ubuntu 16.04 with standard apache web server installed. Nothing special about it. No open ports but 80.
Instead of the default index page I put this one:
...
1
vote
0answers
38 views
List all files matched by glob within JSON file
Based on a set of globs contained in a custom field within a package.json file, I'm trying to get a list of all the files that the glob matches. In my continual quest to get more familiar with ...
1
vote
1answer
44 views
File / Folder Tally Tool
I'm trying to learn C++ having come from a C/Assembly background. I thought one of the first tools I'd make as a project is a "directory tally" program:
It will count all the files in the current ...
3
votes
1answer
68 views
ArcPy script to analyze land use in counties
We have written a Python script using arcpy modules. It is was written by Python beginners and many parts of the code are written in 'unpythonic way'. The goal is ...
5
votes
0answers
142 views
Recursively search a folder for photos
The code below takes two command line arguments, an absolute folder path and integer, which is the minimum number of qualifying photos in each folder required to return a positive search result.
...
0
votes
1answer
39 views
nodeJS, fs, path - creating new directorties
I wrote this function that takes 2 arguments - the path to an existing file - file, and the newRoot name. The function splits ...
4
votes
1answer
229 views
Removing duplicate files in a given directory
The following code is a python script that removes duplicate files in a given directory. At first I considered the most basic thing: relying on identical names, but you might have 2 different files ...
2
votes
1answer
33 views
Securely Delete All Drive Data
When giving away or selling a PC, one should be careful not to send personal data with it. I'm in such a situation and was using dd if=/dev/urandom of=/dev/sdb bs=8M...
4
votes
4answers
160 views
Basic spellchecker with File I/O
This is a basic spell checking program that I wrote earlier today. It accomplishes the tasks that I had in mind, but was curious about improving my coding style and improving efficiency of my program. ...
5
votes
2answers
102 views
Short script to hash files in a directory
What improvements could be made to this script and can you explain why you would make those changes?
...
1
vote
0answers
43 views
Class for managing (file I/O) data
I want to make an attempt to write my own simple RPG. As a preparation for this task I created a class which I could use to store/retrieve my in-game objects data to/from disc. I chose JSON format as ...
3
votes
2answers
56 views
Building a summary string from a flags enum
I'm trying to replicate the attributes text that appears in File Explorer, for files and directories.
I can't just use the enum names, as the summary text uses a single character for each set flag, ...
4
votes
2answers
73 views
Random playlist builder is slow
I wrote a Python script to scan my music library, randomly select 50 songs, and play them in VLC media player. It works great, just a little slow (takes several seconds to launch).
I know that ...
8
votes
1answer
73 views
Ntree: a reimplementation of the tree utility
tree is described as "a recursive directory listing command that produces a depth indented listing of files" on the homepage for its Linux implementation. I don't ...
3
votes
1answer
50 views
Backup files at the end of the day
This is my first attempt at writing code that moves files at the end of the day, from my local work folder to an network archive.
The program works but, any tips, tricks, or ideas to make this code ...
3
votes
3answers
296 views
Create and back up files
I have to develop a class that creates new files. If a file with the given name already exists, it should be renamed by addition of the timestamp to the file name. The file name should be human-...
8
votes
3answers
261 views
Removing multiple slashes from path
I have been trying to write a sample code block to remove multiple backward or forward slashes from a path (e.g. //a//b should be ...
5
votes
4answers
615 views
Check if a file path matches any of the patterns in a blacklist
I'm processing a list of files, and want to check the filenames against a list of regex, like:
...
3
votes
1answer
14 views
Merging directories and keep files that have more lines
Goal
My goal is to merge directories. Whenever a file has the same name in two or more directories, then only the one that has the highest number of lines should be kept. If both files have the same ...
3
votes
0answers
37 views
Recursively list files in provided directory in the style of `npm ls`
I've written a small CLI node program to list the contents of a directory with an output similar to that provided by npm ls but listing both files and directories, ...
1
vote
0answers
52 views
RSYNC Style Mirror Folder Application
I've written a mirror folder application in C#. It uses CommandLine for command line parsing. I'm just looking for a general review.
...
2
votes
2answers
35 views
Recursive Directory Searching For Filenames
Purpose:
Given a target folder, and a list of target sub-strings, determine if the folder (or any of its' sub-folders) has a filename which contains any of the target substrings.
N.B. This class ...
4
votes
2answers
264 views
Copying directories in Windows 10
I wrote a program to copy directories in Windows 10. I have tested copying a directory (696MB) in 3 different ways:
xcopy: time taken - 52 seconds
ctrl+c: time taken - 78 seconds
My program: time ...
5
votes
1answer
71 views
Wrapper class for the shell “dir” utility
I was inspired to throw this class together by an SO question and thought I'd subject it to some welcome criticism here.
The class is basically just a wrapper around the shell utility ...
5
votes
2answers
73 views
List files in dir
I'm making a program where I need to check if files in the directory are correct (46 files and all 11 chars).
I've got two methods to do it but I don't know which one is better.
Using ...
4
votes
1answer
64 views
Directory listing, sorting and filtering in F#
Here is my first try at F#. My only functional experience is from JS.
This program takes a path as an argument and presents the user with numbered subdirs in that path. The user then selects one of ...
2
votes
1answer
69 views
Filesystem search class in C#
Anyone can tell how to make this code faster?
This search takes too much time... 700 000 files for 15 minutes...
I will be grateful for each micro optimization!
Search Class:
...
4
votes
2answers
102 views
Getting NTFS permissions of all shared folders on the local machine
How can I improve the speed of the script?
...
4
votes
1answer
280 views
Find files with content matching regex
Today I wanted to find a program that I wrote a while ago. I knew that it contained a certain regex, but I couldn't for the life of me remember the file name I saved it under. I knew I could use ...
5
votes
2answers
141 views
2
votes
1answer
73 views
Copying files, renaming conflicts
I wrote a script to copy a file, but this file already exists in the target directory. So, first I need to rename the original file.
The script works, but a colleague did not want to use it because ...
0
votes
1answer
88 views
Finance manager
Somewhat experienced with JavaFX, but this is my first potentially large JavaFX project that I recently started and wanted some feedback on anything that could be done better or more efficiently thus ...
4
votes
1answer
109 views
A simple MP3 file arranger
I am creating a simple Mp3 Files Arranger the Project is on Github
Questions:
How can I optimize this app?
Am I violating any OOP principle?
Is it readable?
How can I make it better?
GUI.java
<...
12
votes
2answers
473 views
Regex Matching a Naming Convention
Program Purpose
So, I have a naming convention for certain folders.
I want to take in a folder name, and determine if it conforms to the convention.
Naming Convention
The convention (case ...
6
votes
1answer
58 views
Validating FileSystem Structure
I have a File System. It is *supposed* to be laid out / used / added to in certain ways.
This is a program to report on the *actual* state of the file system versus what it's supposed to be.
In ...
7
votes
3answers
305 views
Searching files in a directory for a string
I have the following static class that enumerates directories in a folder, then searches each file in the folder (it seems to only work with text files even thought I don't explicitly specify that) ...
3
votes
1answer
59 views
File shredder in x86 NASM Assembly
This is a file shredder utility that runs on Linux. It writes random bytes over the file contents, repeating this 48 times and calling sys_fsync after each pass to ...