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.

35 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
0answers
43 views

Comparing same-size files and reporting on the differences byte-by-byte

I created a small Python utility to analyze multiple same-size files and report on the difference byte-by-byte (i.e. Hamming distance, not Levenshtein distance.) I am planning to extend the ...
4
votes
0answers
111 views

File operations using Groovy

The idea is to read a file - "data" - and write the information to a new file - "output" - only if it meets the criteria (if the resource usage is more than a configured threshold). Content of the ...
4
votes
1answer
168 views

Reading from and writing to a file without passing around filename

I was looking for a way to write to and then read from a file in different parts of my code, without passing the filename around and without consumers needing to know it was coming from a file. I ...
4
votes
0answers
195 views

Text-based Snake game on Window - follow-up

Previous question: Text-based Snake game on Window Summary of improvements: Removed unnecessary functions such as clearScreen() Added new ...
3
votes
0answers
40 views

Simple one-time pad in Rust

I am new to rust and to start learning the language I decided to implement a simple one-time pad encryption program. The part I am least sure about is the reading and writing from the files. Ideally ...
3
votes
0answers
53 views

Parsing version from Cargo.toml

I want to get version from Cargo.toml and use the value inside my app. Here is a function I wrote: ...
3
votes
1answer
779 views

Multi-query PHP Parser for SQL files

I have an external project, which needs to run an SQL file containing multiple SQL queries (a bit like mysqldump, if you like, but is user-created, with any kind of SQL statement/definition). PHP ...
2
votes
0answers
61 views

Game involving finding words containing letters from a memorized list

I wrote this Java game where the user memorizes a list, gets given letters and needs to find a word that contains those letters. The player has only a few seconds to enter the word. Example: Program ...
2
votes
0answers
28 views

Sharing File (Content) without saving it before

I have a listview of PrivateFile objects which contain the fileId (int), fileName (String) ...
2
votes
1answer
57 views

Concatenating an already existing filename to create a new file

I had answered this question from stackoverlow and the code below is code that I wrote to explain to the OP a possible way to achieve what I believe they were looking for. The general idea that I ...
2
votes
0answers
38 views

vb.net Create textfile from template

What is the best approach for creating textfiles from/with a template ? Currently I just read the template from a textfile and Replace all values needed, but I don't think that this is the most solid ...
2
votes
0answers
55 views

Reversing a file in Fortran

This is my first foray into (modern) Fortran in order to learn a bit more about the language, and I'm attempting the following problem: taking the path of an arbitrarily-sized text or binary file ...
2
votes
0answers
90 views

TI-Basic file manager

Tested on my TI-84 Plus CE. Variables: F: Stores the file listing's ID N: Stores the current file's ID ...
2
votes
0answers
534 views

File shredding (secure deletion) algorithm

Does anyone see anything wrong with this? I was considering using something like srm or wipe and use ...
2
votes
0answers
39 views

Handling multiple uploaded images in JavaScript

...
2
votes
0answers
2k views

Download a PDF and submit it as a print job

I have following Java code, which is to print PDF, but in a busy location this code is taking about 20 to 30 second delay before submitting to the hardware. get the PDF file via the network download ...
2
votes
0answers
55 views

CLI app to download a .gitignore file

I have written a simple app that adds gitignore files to the current working directory - it does this by reading files hosted on GitHub and then saving them (...
2
votes
0answers
486 views

Bitmap to base64 and writefile

I have the following code which does 2 things: Return a scanned fingerprint as base64 Store this print as bitmap While the code works most of the time, sometimes an invalid bitmap is saved (I can't ...
2
votes
0answers
135 views

Organising loops for parsing a text file

The following code is from a utility I've written for myself. It takes a file in this format: ...
2
votes
0answers
113 views

Counting words in files - follow-up 2

Previous question: Counting words in files - follow-up I have fixed punctuation problems in my previous code by using template, because it is easy to understand and my focus on template mechanism. ...
2
votes
0answers
2k views

Upload multiple files in different formats and sizes from one HTML form

I have a html form with some text input fields and three file upload fields. two of them should be images and one should be a file (pdf). My code is working well but I feel this is not the proper OO ...
1
vote
0answers
33 views

is there way to make faster to write to a file?

...
1
vote
0answers
27 views

“Function” to extract a file in Batch

Recently, I've been doing more and more Batch "programming". I always find myself in the need to extract a file and do something with the files. This is not my first version, and a few non-general-...
1
vote
0answers
19 views

Encapsulating simple license backup to a disk

I am enapsulating my license backup to disk, using an interface ILicenseProvider and the implementation is DiskLicenseProvider. Also i am throwing an unchecked exception LicenseProviderException which ...
1
vote
0answers
47 views

Excercise from PPP Order class

I did the following two excercise from PPP by Stroustrup: Define an Order class with (customer) name, address, data, and ...
1
vote
0answers
37 views

Speed up generate excel file

I have little knowledge about java (I'm just starting). I have issues in my generate excel file code. It takes some time to generate the file. Could you please take a look at it? ...
1
vote
0answers
34 views

Check whether or not write permission is enabled in a remote server

I have written C++ code which will say whether write permission is enable on the server or not using the smbclient command. Since the smbclient command is not returning a proper error code if the ...
1
vote
0answers
365 views

Save protobuf-net serialized data with variable length to a file

My program gets continuously raw input from a stream (TCP), then process the data and output the data to a graph. It should also save the data to a file so it can be read afterwards. To archive this I ...
1
vote
0answers
36 views

Script to append a new method to a XAML code-behind file

My company is converting a VB.NET project to a C# application and I was tasked with writing a script to automate part of the process. In particular, given information about a control name and event in ...
1
vote
0answers
26 views

Unlock spreadsheet files - follow up 2

Awhile ago I created a program that unlocked spreadsheets, for a better understanding of what happens when it's run, see here. I decided to rewrite it again, and go for a more OOP approach.. My ...
1
vote
0answers
48 views

Iteratively process an identically named file all subdirectories and plot analysis to root directory

This script can successfully go through all of the subdirectories in a root directory, and then process a specific file that exists in all of them and output the file in the root directory as a .png ...
1
vote
0answers
98 views

Counting words in files - follow-up 4

Previous question: Counting words in files - follow-up 2 Continuation of the meta programming template version of counting words. Inspired by example of pirntf ...
1
vote
0answers
164 views

Extracting country data from HTML tables

I am trying to optimize/improve my coding skills in python The rationale behind this code is to extract some data from files and store them in a dictionary. I tried to comments lines to improve ...
0
votes
0answers
44 views

Optimize the file content comparison

Program to compare if files within two directories are having same content I followed the approach of getting the list of files under two directories recursively and store it in different list with ...
-1
votes
1answer
712 views

Reading bytes from file to compute its SHA256 hash

I need to get text hash (sha 256), so I need to convert file to its type representation. Is this a fast way to get a byte representation of a file? ...