1,773 questions
-1 votes
1 answer
163 views
Why does fwrite output spaces between characters in the file?
I have a button on my form that has a text box that is supposed to have some written text. Here is the code: // Saves the text in blahwnd to a file called something.txt FILE* clickfile; fopen_s(&...
1 vote
1 answer
118 views
The data is changed after fwrite and fread
I am trying to store several columns of the data, and then merge them with the other data when necessary. However, the data could only be merged with other data when I created it at the start, and it ...
4 votes
2 answers
132 views
how to change color in a string in c?
My problem is that I have a string which is colored gray, the string is almost 1000 characters long. 2 of them must be in another color (red), but I don’t know how to change the color in the string. ...
1 vote
1 answer
189 views
C and C++ program saving trash lines when writing to text file from string/char array
I'm working with a program that produces text lines with tab-separated numbers as output, about 1 line every 2 minutes, each line having at most 51 characters (including the tabs). I piped its stdout ...
1 vote
2 answers
105 views
Is fwrite() atomic when applied to multiple FILE*, same file descriptor?
using fileno() to get the actual file descriptor of stdout. using fdopen() to create two different FILE* structure, named a and b. creating two threads, name A and B, using fwrite() to write some ...
0 votes
2 answers
116 views
Python - Concurrent file seek and write
I'm making a concurrent file downloader, which downloads in segment files and merges them afterwards. I want to improve it by pre-creating a big file with the whole size, then each thread will seek ...
0 votes
1 answer
105 views
C - Linux proc file syncing / write deferred
I have a simple watchdog mechanism made as follow: A kernel module which holds a list of thread counters in a /proc file. The module increments each counter every second. When a counter reaches its ...
0 votes
1 answer
144 views
How To Remove the "Â" before "£" when exporting to csv with fwrite in R
I have this code: #set working directory setwd(dirname(rstudioapi::getSourceEditorContext()$path)) dt = data.table( Product = c("a","b", "c", "d", "e"...
0 votes
1 answer
345 views
How to get rid of C6387 warning on call to fwrite function?
In Visual Studio 2022, I am getting the following warning when I call fwrite. Warning image C6387 It says: C6387:'fout' could be '0': this does not adhere to the specification for the function 'fwrite'...
1 vote
0 answers
124 views
Set properties of an exe using Golang
Here's what I have so far: package main import ( "os" "github.com/saferwall/pe" ) func main(){ exePath, _:= os.Executable() peFile, _:= pe.New(exePath, &pe.Options{}) ...
0 votes
0 answers
33 views
File data is lost during the device power-off and power-on test
When the device was testing power off and on, it was found that the content of a json file was missing. The function to operate it is as follows: /* 将json写入文件 */ FILE *pf = fopen(file_path,&...
3 votes
0 answers
113 views
Malformed gzip file with R {data.table} fwrite
I'm saving a large data.table object as a compressed file using data.table::fwrite(data, 'data.csv.gz'). However, when I try to extract this file using Ubuntu file manager, I get an "empty ...
0 votes
1 answer
44 views
After using the php function fwrite: extra dots inside the file when viewing online (not after downloaded)
I have a function that create a file using the function fwrite. I've noticed that after the file is created, if I open the file using the online file manager of my host, I can see an extra dot inside ...
0 votes
1 answer
113 views
Writing UTF-16 directly to stdout with fwrite not doing what's expected
I'm trying to figure out how to write to the console in UTF-16 mode directly (without wprintf) as part of a solution to another problem and wanted to do this directly in C first. Here is an example of ...
1 vote
1 answer
105 views
Trouble writing/reading struct array in a binary file in C
I am trying to make a program that stores the name, employee number and salary of employees in a database, where I have to then store the amount of employees along with all the information of each ...