81,314 questions
-6
votes
0
answers
50
views
How to extract a ZIP website file and run it in VS Code? [closed]
I developed a website using vibe coding and downloaded it as a ZIP file. How do I extract the ZIP file and run the project in VS Code?
Advice
0
votes
0
replies
46
views
Designing atomic product + media upload flow with Supabase Storage
I’m building a system where users create a product with multiple media files (images/videos).
Tech stack
Node.js / Express backend
PostgreSQL
Supabase Storage (object storage)
Current flow
Client ...
5
votes
1
answer
189
views
Does ferror() indicator remain on when writing to a file?
I'm writing to a file using C, and would like to be sure to catch any errors in time, not necessarily immediately when the error happens, but still before I close the file.
My current approach is as ...
Advice
0
votes
3
replies
49
views
How to create an empty file with a specific number of empty lines?
I need to [create a file with a specific number of empty lines], to which strings are then added to later. I know how many lines the file will need, but not yet how many strings per line, or in which ...
1
vote
1
answer
68
views
How do I get the last modified date of a file in POSIX sh?
I want to get the last modified date of a file, preferrably in UNIX nanoseconds for easy comparison. I see two solutions online (assume $1 has the filename):
stat -c %Y "$1"
and
date %s%N -...
Tooling
0
votes
2
replies
44
views
How to split text file into multiple other files based on its contents
I have a large tab-delimited text file with the following structure:
AAA.xyz<tab><various other tab-delimited values>
AAA.xyz<tab><various other tab-delimited values>
BB.xyz<...
Best practices
0
votes
4
replies
139
views
how to replace a string within a text with the contents of a file once or multiple times
I want to replace one or many occurrences of a certain string with the content of a file, e.g.
This is some text with a certain string to replaced with the content of a file. The string to replace ...
Advice
0
votes
2
replies
117
views
Can one program change a Python file *in RAM* that is open by another program?
When a program like VS Code or any other program opens a file, let’s say it is a Python file, it loads it from the hard drive into RAM. Is it possible for another program to change the Python file ...
Best practices
0
votes
1
replies
56
views
Do media types provide for unregistered parameters on a standard type?
Media types (aka MIME types), defined in RFC 2045 § 5.1 can have parameters such as text/html; charset=UTF-8. There is also an unregistered tree for subtypes, e.g. text/x.mytextformat (defined in RFC ...
5
votes
1
answer
177
views
Bash test - [[ -s /dev/stdin ]] - is never True?
consider script.sh:
#!/usr/bin/env bash
set -xv
[[ -s ./script.sh ]]
echo $?
[[ -e /dev/stdin ]]
echo $?
[[ -s /dev/stdin ]]
echo $?
cat /dev/stdin
when executed:
$ echo this is some stdin | ./...
Advice
0
votes
2
replies
40
views
Monitoring a folder with subfolders for newly added files using python
I would like to monitor a folder with subfolders where every minute a new file is added (by another application). I need to process these files in python as soon as they are added. The folder contains ...
1
vote
1
answer
96
views
Incorrect behavior when removing items from a task list in C (duplicated data when reading file)
I am developing a simple command-line to-do list application in C as a learning exercise.
The program allows adding, viewing, updating, and removing tasks, storing them in a text file.
Adding and ...
-2
votes
1
answer
126
views
How to allocate a value of a line from a file into an array in C? [duplicate]
I've been learning C programming for a few weeks, and I made a couple of projects, and now I'm working on my third one.
It's a simple CLI to-do list. I'm facing problems in the data persistence part. ...
-1
votes
1
answer
69
views
Outputting data from results of compartmental ODE model
I'm learning Rust and have a (apparently) working example compartmental ODE model using the pharmsol crate to solve the ODEs. This code works correctly to output the results of 3 fluxes, over time (...
0
votes
1
answer
161
views
Get a file name with extension from a folder and use it for opening
The main function contains arguments check and a switch for arguments so in packing process, the argument -p FOLDER is passed. The basename does its thing to get the folder name from the path but I am ...