Questions tagged [file]

A block of arbitrary information, or resource for storing information, accessible by the string-based name or path. Files are available to computer programs and are usually based on some kind of persistent storage.

Filter by
Sorted by
Tagged with
2 votes
1 answer
124 views

Image file uploader webpage in HTML5 and PHP

I am trying to make a webpage for uploading an image file and storing the uploaded file on server. There are several features in this implementation: There is a drag & drop zone on the webpage. ...
-1 votes
1 answer
51 views

Handling exceptions of FileInputStream and XSSFWorkbook

Can you tear my code apart with code review comments? Below is a simple method which reads an XLSX file and does some stuff with it. I use FileInputStream and ...
2 votes
1 answer
169 views

Swift-function: Copy directory recursively

Task description: Implement a function, which accepts two paths: The path to a source-directory & the path to a target-directory. The function shall return true if the directory has become copied ...
3 votes
1 answer
42 views

Program using java.io that shows the content of a text file and every three lines the program stop reading, waiting to press Enter

I am doing a program in Java your text using java.io that shows the content of a text file and every three lines the program stop reading, waiting to press Enter. I dont know so much about programming,...
3 votes
2 answers
167 views

Add offset to all filenames

From all the files in a directory, the method shiftFilenamesOffset is to increment the numeric part (int) of the alphanumeric filename by offset each time, and ...
0 votes
1 answer
39 views

Ruby-function for reading, parsing a text-file, removing data-duplicates

Task description: Implement a generate_unique_phone_numbers function. The function shall parse the given text-file. Content-example: ...
1 vote
3 answers
96 views

Print last lines of file

Task Write a Ruby function, which accepts a path to a text file and returns a string consisting of the last n lines in reversed order, separated by commas. Example input file: ...
8 votes
5 answers
1k views

Find out all the different files from two different paths efficiently in Windows (with Python)

Well, recently I'm working on a program which is able to sync files between different folders. However, as a fresh man, the algorithm I worte seems feasible, but looks really disgusting, and ...
2 votes
2 answers
106 views

Increasing writing speed to file inside a for-loop for large files

I have a .csv file containing 100 millions records, I would to create multiple files from this file, after certain condition satisfied in each line, I came to this code below, but it is slow, I think, ...
1 vote
1 answer
209 views

Replacing NOUNS, VERBS, ADJECTIVES in a text file with input words

I've written code for a program that reads a text file, checking if there's any capitalized parts of speech of specific types (noun, adj, verb, adv) in the text and replace them with the user's chosen ...
4 votes
2 answers
1k views

Logger that writes to text file with std::vformat

This class has a Log function that appends text to a log text file. It takes a format string and a variable amount of arguments, much like a ...
6 votes
2 answers
226 views

ds - A directory switcher via tags in Windows command line

I have this repository. The idea is that there is a file tags sitting in the users home directory, and which contains the tag declarations of the format ...
4 votes
1 answer
138 views

System Utility to Create Random Files

The following program makes random files. By default, they are of the form /tmp/rfile-XXX. Certain options allow for the user to specify where these files are ...
0 votes
2 answers
60 views

Checking which programs are used for scripting

I have a directory where there are some script files, some binary files, and some subdirectories. I have tried to write a program which gets names of all files in directory, and excludes if they are ...
7 votes
2 answers
381 views

Copy file with text replacement

I am currently learning C++. I coded a tiny program for school and I wonder if there could be issues (like bugs or security issues) with it. Any ways to make it have weird behaviours would be very ...
4 votes
1 answer
109 views

Implement Seek on /dev/stdin file descriptor in Rust

Problem: In order to be able to use the arrow crate's infer_file_schema function with input piped to ...
5 votes
4 answers
178 views

Printing a file

The goal of this function is to print the contents of a file. Pretty much what the simple invocation of cat does. Since C is famously hard, I am looking forward to your comments. ...
-2 votes
1 answer
248 views

Number Plate Generation Program

I wrote a number plate generation program. The program generates number plates for a car registered with a specific Memory Tag and on a specific date. Number plates use the following format: (2 letter ...
1 vote
2 answers
532 views

Geting file-names from the current working directory

The following routine returns the file-names from the current working directory: ...
1 vote
1 answer
137 views

Delete files with specific filename pattern in directory with all extension using python

Preamble The first following code explains the context. ...
3 votes
1 answer
317 views

SImple Inverted Index

This is a simple inverted index I made. The goal is to: Read set of text files from a directory, docs Tokenize them Normalize the tokens by removing punctuation ...
1 vote
3 answers
73 views

FileIO lines to String Converter

I think I made a good FileIO object because I can simply copy-paste whenever I need, however I wonder How I can improve my code. This code takes file path of the target file and turns every line to ...
6 votes
1 answer
1k views

Quote of the day program

Create a class diagram and Java code for the following system and scenario, taking into account the possibility of future extensions. The system is a command line utility that prints a short '...
1 vote
1 answer
147 views

Open a file, with a fallback path if it doesn't exist at one location

I am parsing a file that exists in either app/components/ui or in app/components. If the one in the first dir (...
-3 votes
1 answer
133 views

Opening a directory as a file descriptor creating it if it does not exist [closed]

Variables: conf of type struct Conf whose details are not relevant to this review stores the configuration data being read. <...
4 votes
2 answers
110 views

A simple and fast library/code to store & manage variable data

I've been searching through the different ways to store data and found some helpful and actually great libs like: JSON XML And some neh: text file basic write and read some binary type data storing?...
7 votes
1 answer
202 views

Command-line correlation calculator in Java

I have this Java program that asks for a name of the file containing data rows in the format $$ x_1\ y_1 \\ x_2\ y_2 \\ \vdots \\ x_n\ y_n $$, and outputs on the command line the Pearson correlation ...
2 votes
1 answer
306 views

Sending and receiving files in C win32 using a socket

I have a piece of code to send and receive files on Windows with C. Is this the right way to do it? And am I guaranteed that the full file will be sent and received? Receiving function: ...
3 votes
1 answer
64 views

Python Function that Replicates a Directory's File-Tree for Specific File Types while Changing the Parent Directory

Problem Context: I needed to make a script that would search through all the files in a GitHub Repo and find all the README files within it, then replicate the File-Tree of the Repo to a specified ...
0 votes
1 answer
86 views

duplicate an open file descriptor [closed]

My program implements a function similar to `dup2'. I would like you to please find any problems with the code and what I could improve. code: ...
1 vote
1 answer
202 views

File Abstraction Library

This library is a layer of abstraction over file operations in C#. It aims to provide easy file IO syntax, and implicit error handling behaviors, to ensure robustness in scenarios including, but not ...
2 votes
0 answers
80 views

Simple diff utility in Java using OOP take 2

(See the previous iteration here.) After further revising my code, I have: com.github.coderodde.diff.Diff.java: ...
2 votes
1 answer
122 views

Simple diff utility in Java using OOP

(Previous and initial iteration lives here.) (The next iteration is here.) Now I was able to spare some lines by putting diff related state in an object. Also, I relied on ...
6 votes
2 answers
912 views

Simple diff utility in Java

(See the next and second iteration here.) I have this toy implementation of the diff utility in Java: ...
0 votes
1 answer
54 views

PowerShell to query SQL database with a string from a filename

I am trying to write a PowerShell script that will check a folder for any files and then for every file it will grab part of the filename and check it against the SQL database. If it found a match, it ...
3 votes
1 answer
327 views

PHP local document crawler

I've written a quick "local document crawler" that fetches the title tag and an expandable amount of metatag information from files on a webserver. I develop in .NET for a living and don't ...
1 vote
1 answer
193 views

File dump in assembly

This is a file dump program written in assembly that displays 320 bytes at a time in 20 lines. It shows the hex code for each character and also the string At the start of the program it asks for the ...
2 votes
2 answers
204 views

No Reference Image Quality Assessment for Video in Matlab

I am trying to perform the No-Reference Image Quality Assessment (NR-IQA) calculation on video. Several NR-IQA methods including Naturalness Image Quality Evaluator (NIQE), Perception based Image ...
2 votes
1 answer
862 views

Hashing with python optimization, hashlib and multiprocessing

I am looking to get any type of improvement, I want to be able to hash a list of 'blocks' aka strings and check if hashes match per block, if you can help me with that, currently reading and writing ...
1 vote
1 answer
637 views

Adding string to a text file without duplicates

I have a function below, store_in_matchid_file, and it adds certain strings to a .txt file as long as that string doesn't already exist in the file. However that ...
2 votes
2 answers
3k views

touch command in C

I wrote a program in C that simulates the touch command from linux. I would like to ask you to criticize my implementation, to find bugs in particular ...
1 vote
1 answer
81 views

Unit tests for PNGme steganography exercise in Rust

I want to become proficient in Rust and I've followed the PNGme exercise. I've completed it up until Chapter 4 included, where I've written a lot of tests myself for verifying that the command line ...
1 vote
1 answer
138 views

Passwords with C++ Console

I am really, really new to coding in general and especially c++. To get more familiar with c++ I am trying to do a series of projects with c++ console apps. One of my projects is with a database that ...
3 votes
3 answers
148 views

tee: copy standard input to both stdout and a file

I implemented the tee command from linux. The program also handles the -a option for adding text to the end of a file if it ...
3 votes
0 answers
871 views

Android APP FTP downloading file implementation in Java

This is a follow-up question for Android APP connect to FTP server in Java and Android APP FTP uploading file implementation in Java. I am attempting to perform the download operation to specified FTP ...
1 vote
0 answers
74 views

Creating a reusable DictWriter context manager

I want to simplify the repetitive work of creating a DictWriter in a with context manager. So I created a ...
3 votes
1 answer
147 views

Processing a binary file with buffer length tags

I am trying to process a very large binary file using MappedByteBuffer from java.nio package. This is how the data looks like in the file: ...
2 votes
4 answers
4k views

Randomly pick a first name from a file

I have a very easy question for you guys out there. It's been a while since I took my programming courses (switched majors) but am trying to get my feet wet again. Objective: I will be creating a ...
3 votes
1 answer
2k views

Python code to get all lines between two keyword lines in a file (with exceptions)

I have coded multiple variations on this and would like to make it generic, to avoid coding any more variations. Comments and suggested improvements, please, (typos also), and what about that ToDo ? I ...
6 votes
2 answers
5k views

AES File Encryption / Decryption

I've been looking for a while for the right code to encrypt/decrypt files with AES in vb.net. I created the code below. Is this the right way doing AES encryption/decryption nowadays? ...

1
2 3 4 5
17