Use this tag for reviews of code that performs file system operations, such as creating, deleting, renaming, moving, copying, reading, and writing files.

learn more… | top users | synonyms (2)

2
votes
2answers
28 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
253 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
46 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
65 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
49 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
49 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
78 views

Getting NTFS permissions of all shared folders on the local machine

How can I improve the speed of the script? ...
4
votes
1answer
167 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
93 views

Move files to specific directory, according to file extension

I've written the following script ...
1
vote
1answer
29 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
53 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
86 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
456 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
54 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
222 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
33 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 ...
7
votes
2answers
227 views

Get directory permissions for all directories in tree

I have made a program that given a directory, will get the permissions for that directory and all sub-directories. The output is stored in a string that can be easily written to .csv. Each permissions ...
3
votes
0answers
29 views

Concurrently identify duplicate files from size ordered list

Following on from my program to identify files that have common file sizes, I have developed an application that takes the output from that process and then compares each of the files that are the ...
5
votes
1answer
63 views

Recursively traverse directory tree and print all files

I want to build a small console program, that for given directory, will print (for now) all files inside that tree. Here is an F# script that I came up with: ...
0
votes
1answer
46 views

Code to join filesystem path strings in PHP

Following code has some issues: ...
12
votes
6answers
712 views

Bash script that lowercases files

I have the following bash script that: Finds all files with .cfc and .cfm extension and converts them to lowercase Stores the ...
1
vote
0answers
42 views

Event log implementation with TDD

Below is some code that implements an 'event log' whose purpose is to record events and periodically check that all events were recorded in chronological order. The collection of events must be ...
4
votes
2answers
81 views

Write MD5 hashes to file for all files in a directory tree

I'm ultimately trying to compare the MD5 hashes for files in two disparate directory trees to see if files are missing from one directory or the other. More broadly, I'm pushing photos from my DSLR ...
4
votes
1answer
760 views

Check if a file exists in a directory or parent

I want to check if a file exists in a given directory or in the parent one, so I wrote this code: ...
4
votes
4answers
162 views

Implemenation for concurrent file access (read/write)

I am developing an application that works with files and folder on a network share (similar to the windows explorer). The application is used by multiple users and provides some commands for modifying ...
2
votes
1answer
43 views

Movies wrapper script [closed]

I'm trying to do a nice script to be able to wrap my movies. Can you help me to improve it? I want to structure my code better but I don't know the language enough to do it. ...
4
votes
2answers
82 views

Compare files by name in two folders A and B and delete duplicates from folder A

I wrote my very first Python program to answer a Super User question. I'm wondering how the application can be rewritten to make it as pythonic as possible. Unit test ...
1
vote
0answers
34 views

Tab completion for custom shell

The purpose of the code is to enable tab completion for a custom shell I'm writing. The target OSes are Linux and OpenBSD. I had to make a conditional include that I hope is correct: ...
10
votes
2answers
298 views

Identify files within folder structure that have common file sizes

The code takes in two arguments, a path to search and an output file name. It searches the supplied path (including sub directories) and writes out all files that have the same size as any other ...
3
votes
3answers
128 views

Removing numbering gaps in a series of filenames

I've recently started programming and have been working through some problems such as the one below: Write a program that finds all files with a given prefix, such as spam001.txt, spam002.txt, and so ...
2
votes
2answers
104 views

Simulate the “cd” command of a file system

Write a function that provides change directory (cd) function for an abstract file system. Notes: Root path is '/'. Path separator is '/'. Parent directory is addressable as "..". Directory names ...
3
votes
1answer
44 views

Create a new unique file

For debugging purposes I am storing requests into files. This code is supposed to create a new file for each request. Somehow it doesn't look very nice, can it be improved? Additionally it would be ...
4
votes
2answers
83 views
1
vote
1answer
46 views

Foldify - A Python Folder Tree Manager Tool

The goal was to create a tool to help manage folders structures, and allow me to create templates of this folders and store them as a JSON template. The following functionalities have been implemented:...
-2
votes
1answer
54 views

What is better: join(dirname(__file__), '../../../testdata')) or join(dirname(__file__), '..', '..', '..', 'testdata'))

Both ways work: os.path.join(os.path.dirname(__file__), '../../../testdata')) or ...
1
vote
1answer
124 views

Move a folder to another in C#

In C# I wrote a method to move a folder into another existing folder: ...
4
votes
2answers
105 views

Importing JPG, JPEG, and PNG images from a folder to an Excel worksheet

As I am a novice, I was keen to solve the task, so now I want to optimize the code. ...
6
votes
1answer
193 views

UWP scan for music files

I am implementing a music player for Windows 10, and I am in a bit of a pickle at the library phase. I am scanning for all the files in a music library (plus optional folders the user selects) and I ...
1
vote
1answer
19 views

Optionally creating a directory path based based on existence in NodeJS

I've been doing some reading and tutorials. As such I've contrived a node based project to apply what I've learned. I thought this was a good example as it had some conditional async calls and error ...
3
votes
3answers
107 views

Loading modifications at runtime

I'm working on a game engine among other things in Java, and would like to know how to optimise my code, as it is ridiculously ugly and bloated. I'm terrible with operating the ...
6
votes
2answers
177 views

Parsing locally stored HTML files

I am working with this code to parse through HTML files stored on my computer and extract HTML text by defining a certain tag that should be found: ...
3
votes
1answer
46 views

Converting images to greyscale using JuicyPixel

I would like to use Haskell to do some image processing so I have been writing small programs to test performance. I wrote a program to batch convert PNG images from color to greyscale. I compared the ...
3
votes
3answers
47 views

Grouping filenames by basename and extension

I have created a function that parses a directory tree, and returns a list of lists that groups specific files within for later program specific parsing. I feel like it could be done better, ...
2
votes
1answer
36 views

Recursively walk directories with a callback function

This code works, but I want to refine it: ...
6
votes
3answers
113 views

Simple file renamer in C

It's been some time since I wrote something in C. I am looking for some advices related to my code in terms of coding style, bad/wrong logic, optimization (performance) and good practices. The code ...
1
vote
2answers
108 views

Finding all non-empty directories and their files on an SFTP server with Paramiko

The purpose of the following function is to find all non-empty directories, and the files in those non-empty directories. It recursively checks each directory on an SFTP server to see if it has any ...
1
vote
0answers
41 views

Simple program that copies just new files from one directory to another

I'm doing a Python course for beginners, and the last assignment was to create a program using shutil and wxpython that can copy new files (created in the last 24 hours) from one folder into another, ...
2
votes
1answer
126 views

Create share folder, AD security group, add descriptions, and apply security to new folder

My goal for this script was to: Create new folder Create AD group FS-TESTSHARE-R Create AD group FS-TESTSHARE-RW Apply both groups to the new share folder Set full read permissions to FS-TESTSHARE-R ...
3
votes
1answer
56 views

Uploading multiple files using a class

Below I have implemented a class that will validate and upload files based on the specified rules. ...
7
votes
1answer
96 views

Batch script to make folders hidden

I just wrote a simple script cmd to hide private folders by combining several scripts from the Internet. Can anyone give me suggestions for improvement? This batch file uses a password hidden by ...