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

4
votes
1answer
83 views

Installing Mods With Python (v 2.0)

My original code is here. I made some changes to it based on your suggestions, but then I lost my flash drive and had to redo it. I have a suspicion that my second version was better than this one, so ...
5
votes
1answer
57 views

Need reviews for impacts of dirty bug fix

I was having a hard time with bug logstash#665. Hope they will fix it some day, but sparc/solaris support is probably not on top of their priority list. For further reference, original error is: ...
4
votes
2answers
46 views

Packaging a single-file Python copy-tool

I'm currently working on a very simple one-file project: Lumix provides the possibility for the camera TZ41 (and others) to load GPS data and tourist information from a DVD to a SD-card so that you ...
1
vote
0answers
26 views

Reliability of flock mutex (LOCK_EX|LOCK_NB)

I would like to test reliability of system flock in a multi-threaded and concurrent environment as some suggest that they are not reliable (in comments). Thus I ...
4
votes
1answer
70 views

Security: Scale and cache images

Specification A simple PHP script resizes images on-the-fly. The script is called by the web server's 404 handler to return a scaled version of the original. For example, if the original image is at: ...
9
votes
1answer
164 views

Allowing user space file-system to (kind-of) keep more than maximum number of files open

The linked code below is meant to be used in a user space file-system (fuse). Given that multiple processes may have multiple files opened on the file-system, the files on the specific user space ...
4
votes
2answers
52 views

Proxy evasion browser in Python

This code works. It is designed to retrieve website data directly, parse it, and open it as normal. I will develop it further later. Right now I want to know if there is any way to improve efficiency, ...
13
votes
1answer
113 views

Regular backup/snapshots

A (long) while ago I set up a file server in my basement running Linux. I am OCD when it comes to backups. I set the server up with (remember, this was a while ago): disk for OS disk for 'valuable' ...
2
votes
1answer
36 views

Loop filling a set with logging

After watching Raymond Hettingers talk Transforming Code into Beautiful, Idiomatic Python I got back to a function I wrote. I'm not quite sure how to make it more pythonic but I think this might be a ...
6
votes
1answer
151 views

Byte by byte directory comparison ignoring folder structures and file name differences

I haven't been able to find an existing tool that does this, so I'm attempting to create one. If anyone knows of one that already exists, I'd appreciate a pointer to it. I plan on using this primarily ...
5
votes
1answer
116 views

Python script using distutils to copy files on a Mac

I have a Python script I have written to copy files to a mounted Windows SMB share on a Mac. ...
10
votes
1answer
90 views

Follow-up to tool for posting Code Review questions

Description This is a follow-up question to Tool for creating Code Review questions. Things that has changed include: Removed replacing four spaces with one tab, all tabs and all spaces in the ...
7
votes
2answers
224 views

Sorting a set of numbers in a file using Java BitSet

I have implemented a program to sort a file consisting of numbers. The program generates a different output file with all numbers sorted in it. I have implemented this program using BitSet. I wanted ...
8
votes
3answers
144 views

Search for directories with a certain prefix that contain no files of a given type

These two functions search for directories with a certain prefix that contain no files of a given type. Does the code adhere to Ruby standards and conventions? Am I doing something the hard way or ...
5
votes
2answers
135 views

Optimize disk enumeration and file listing

I am writing C++ code to enumerate whole HDD and drive listing. However, it takes more than 15 minutes to complete the disk enumeration of all drives (HDD capacity 500GB) and compile the response in ...
4
votes
2answers
104 views

Shorten code that gathers files from directories

I have the following method in Ruby that appears to be just one line too long according to Ruby style guides. (Specifically: Rubocop tells me that my method has too many lines.) Granted, I'm only one ...
2
votes
3answers
105 views

Python script to touch files of a particular pattern in all folders of a given name

The intent of this script is to hunt down all "*/testResults/*.xml" files and touch them, so that our build system doesn't issue errors that the files are too old ...
1
vote
1answer
76 views

How to ensure file exists, and get the absolutePath? [closed]

I need to: create an object with the absolute path of a file ensure the file exists My approach is to create a new Path and call toFile to make sure it exists - ...
5
votes
1answer
105 views

A Program that Finds Empty Folders

I wrote a program that finds empty folders and subfolders in a directory. It's the first program I've ever written in Java, and I'd like some critique. I feel like I'm not utilizing classes in a very ...
6
votes
2answers
94 views

Batch rename flac files

This is my first real program in python (and my first real program) and I would like to have input by some more advanced programmers on the code, on the writing style and on the amount of comments (is ...
4
votes
2answers
71 views

Is there a 'better' way to find files from a list in a directory tree

I have created a list of files using find, foundlist.lst. The find command is simply ...
5
votes
3answers
163 views

Improve this image file browser (remove redundancy)?

Let me start by saying that the code works as is but I think it has a lot of redundancy. It is written this way as I kept getting nullpointerexceptions if I try to put the fileCounter > gameDiff ...
3
votes
1answer
333 views

Need advice on file/directory enumeration code

In various projects I need to enumerate all files and folders from a specific root folder, either on a local drive or across a network. I've broken the task down into two ...
-2
votes
1answer
40 views

Listing daemons from Linux [closed]

I have this code that lists daemons from Linux. I use /proc filesystem to get the data that I want to read: This is the file structure: ...
3
votes
4answers
576 views

Compare last modification time with specfied time

I'm writing a function in Python that compares the modification time of a file in Linux (using os.stat) with a specific time and compare the dates. If the modification date is older than the date I ...
2
votes
1answer
147 views

Search through server folders and display files that exist [closed]

I have a folder called uploads in this folder is a folder for the year the file was uploaded(2013,2014,2015 etc...), inside the year folder are usernames(rick, dan, edward etc...), inside the ...
2
votes
1answer
55 views

cocoa change whether file is executable

This is a cocoa app that adds a right click menu option to change whether a file is executable. It works by executing the system command chmod on each of the files. ...
-2
votes
1answer
176 views

TV guide program and client server with sockets

I am fairly new to Python coding, although I have been coding on and off for 30ish years. I am sure I am writing Python with too much influence from the other languages, such as REXX, VB, and some ...
5
votes
1answer
401 views

Small backup script in Python based on 7-Zip

Is this reliable? While there are many backup programs out there, it is still hard to find free software that allows unattended differential backup on Windows. Completely rolling something from ...
3
votes
2answers
128 views

Improve my script to organize a video collection

I've made this script the other day, and I need some input from you telling me how could I improve the code / style. There aren't problems with the code (it does the job) but I want it more organized ...
5
votes
3answers
556 views

Can I make this faster?

I'm not familiar with threads but I am not against them either. A bit of background the original program would have taken about 2 years to run. I had modified it and knocked down that time to around ...
2
votes
1answer
247 views

Moving and organizing files in download folder

This is a Python script that I use on my Android tablet. It moves the files in the download folder to a folder on the external SD card. The files are sorted based on their extensions and are moved ...
3
votes
2answers
145 views

Java app for getting metadata of millions of files in a directory

I am writing a Java app that gets the metadata of files in a directory and exports it to a .csv file. The app works fine if the number of files is fewer than a million. But if I feed in a path that ...
3
votes
0answers
451 views

Python files sync

I'm trying to do a one-way directory sync. Given a list of existing files in a dir, I'd like to make the files in the dir equal a new list of files. There will be subdirs under the dir. Because ...
3
votes
1answer
262 views

How to replace duplicate files with hard links using python?

I'm a photographer and doing many backups. Over the years I found myself with a lot of hard drives. Now I bought a NAS and copied all my pictures on one 3TB raid 1 using rsync. According to my script ...
1
vote
0answers
98 views

Directory's disk usage list

For my classes, I had to finish this task: Directory's disk usage list For indicated directory print a list of files and subdirectories in descending order according to their total disk ...
1
vote
2answers
432 views

Securing an Image Upload Script

How well does this code limit security problems when uploading images to the server? ...
5
votes
2answers
339 views

Simple C++ File Indexer

I didn't realize I am not a very good programmer at recently. I just come out from Uni, I want to become a reliable teammate. Please help me to improve my coding style/habbits. I have carefully ...
4
votes
1answer
382 views

Monitor filesystem for continuous integration and build

I've written a simple Python module that depends on watchdog to monitor for modified files, then runs various integration and build processes. I'm fairly new to Python, so I'd appreciate all ...
2
votes
2answers
67 views

Better way to create directories using File

I have this code that generally creates directories within a directory. ...
0
votes
1answer
400 views

'How to debug Buffer Overrun Issues' erro. Can someone help me to fix my code? [closed]

I have this code that reads a file that already exists, but in the first "for" when it read the file and copies it to the "struct" when the index is 1, I get an error: (A buffer Read overrun has ...
4
votes
1answer
566 views

Renaming Files and/or Directory

I'm quite new to Python and would love to gather feedback on my code. I've written a piece a script that allows me to search all file or directory names within a folder matching a particular pattern. ...
4
votes
4answers
185 views

Improving C file reading function

I am programing in C language and have created the below functions to read files. There are two functions that I can use to read files. I wanted to know how I can further improve these two in terms of ...
2
votes
2answers
444 views

Python script for a git repository

I am a newbie regarding Python and I would like to improve my Python-fu. As a learning exercise, I decided to write a script for helping me maintain my Unix configuration/dot-files under a git ...
2
votes
1answer
202 views

Tips for Python build scripts?

File manipulation code, I've noticed, has two salient properties: It's everywhere, and vitally important to functional software It has lots of exceptions. Please give me some pointers on ...
5
votes
2answers
307 views

PHP - Optimizing Recursive Method

Here is a recursive function that I wrote to search a file-system to a child depth defined by $depth. Could it be optimized more? ...
4
votes
1answer
239 views

Execute multiple query from a text file

I am just wondering if this is a correct way to execute multiple query from a text file. ...
1
vote
1answer
453 views

How can I further optimize this Perl script for finding all unowned files and directories on Unix?

(Originally posted on Stack Overflow) Following my findings and suggestions in my other post How to exclude a list of full directory paths in find command on Solaris, I have decided to write a Perl ...