2,945 questions
Advice
0
votes
4
replies
89
views
How do I replace a certain file in a directory with the old one if it gets downloaded again?
I've been trying to figure this out for a while, but I can't seem to find a clear answer.
Is there a way to replace a file that already exists in a directory?
Context
I'm building an API that ...
-2
votes
0
answers
106
views
How to make Windows file processing go at a bearable speed? [closed]
I am building a music player and I need to load in a music library, so naturally I need to process a large quantity of files quickly. I only need a small portion from the beginning of each music file, ...
0
votes
0
answers
35
views
Re-opening a file from handle in a cross platform way
Consider a situation where you have a file handle and would like to open a new file handle from it. You might want to do this because you need different access rights, or perhaps you want the two ...
3
votes
2
answers
228
views
How to properly read a file into an array?
for a larger project I've been experimenting with file handling in C. Essentially, what I would like to do is: load a one-dimensional string of numbers from a text file into an array which is a part ...
1
vote
1
answer
22
views
How to safely transfer file handle ownership in async functions with try-finally?
I am building an http server in NodeJS and the book I'm following has this suggestion on resource management:
In the serveStaticFile() function, after constructing the BodyReader and before returning, ...
-2
votes
1
answer
129
views
Script to Use Virustotal to Convert SHA256 to MD5
I sometimes get a huge list of SHA256 hashes that I need the MD5 version of. VirustTotal contains this information but doing 200+ manually is not really feasible. I have a script cobbled together from ...
1
vote
1
answer
83
views
How to sort files inside a directory to follow order by file size?
I have a directory in which I have 3 files, 2 being directories and another which is a mimetype. I want to keep the mimetype as the first file in the directory, so I made the mimetype first inside the ...
0
votes
0
answers
39
views
How to upload files to folder using Multer package in Node.js?
I have the following code prepared in Node.js:
const express = require('express');
const multer = require('multer');
const app = express();
const upload = multer({
dest: "./...
-1
votes
1
answer
68
views
Issue during file handling in python while 'write' operation
There is a test.txt file which has 'Hello, world' in it already. I am running the code shown below
with open('test.txt','r+') as f:
print(f.read(3))
f.write("wow!")
f.flush()
Final ...
0
votes
2
answers
121
views
Why does the text I'm writing to a file keep changing to Chinese characters? [closed]
I'm new to C and trying a program to open a file and write text to it but the text keeps showing up as Chinese characters in the file
#include <stdio.h>
#include<stdlib.h>
//
int main()
{
...
0
votes
1
answer
48
views
File upload issue via Javascript form in Flask
I'm writing a small Flask program, which involves a user uploading PDF files via an html/javascript form in the frontend, which are processed together in the backend.
Testing on Ubuntu and Android (...
5
votes
2
answers
161
views
Read data into an arraylist [closed]
I made a very simple program with a GUI where the user inputs the file name and the program itself calculates the mean of a file containing numbers only. I did this by creating a function that reads ...
0
votes
1
answer
70
views
Drag & Drop in SwiftUI fails to handle public.data for all file in Mac
I’m working on an app in SwiftUI, in which I want to support drop file functionality to handle any files. While I try implement this, I am trying accept any files dropped into a custom drop area and ...
2
votes
2
answers
171
views
How to process a massive file in parallel in Python while maintaining order and optimizing memory usage?
I'm working on a Python project where I need to process a very large file (e.g., a multi-gigabyte CSV or log file) in parallel to speed up processing. However, I have three specific requirements that ...
1
vote
0
answers
27
views
Reading a JSON file probably while it's being written, would that cause any issues? [duplicate]
I am working in Laravel and presenting you a simplified version of what I am trying to achieve.
Assume a JSON file called site.json containing the following:
{
usedDiscounts: 10
}
Every time a ...