Skip to main content

Questions tagged [fwrite]

fwrite stands for file write. It is a function available with PHP, C, C++, etc. for writing the contents of string to the file stream pointed to by handle.

fwrite
0 votes
1 answer
51 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'...
lussco's user avatar
  • 3
1 vote
0 answers
42 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{}) ...
Ethan Leonard's user avatar
0 votes
0 answers
22 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,&...
work aaron's user avatar
3 votes
0 answers
44 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 ...
Daniel's user avatar
  • 556
0 votes
1 answer
29 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 ...
cactusman's user avatar
0 votes
1 answer
70 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 ...
ThatOneShortGuy's user avatar
1 vote
1 answer
66 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 ...
DeePyson's user avatar
0 votes
1 answer
69 views

Integer File Not Opening Correctly

I apologize that this is probably a question with a very simple explanation, but I can't seem to find it. I'm currently trying to build a basic database with C. I need to save a structure-linked ...
Ratdude's user avatar
  • 67
0 votes
1 answer
93 views

raspberry Pi Pico, writing char array to file on SD Card

I'm using the pico C++ SDK and VS Code on windows 10 pc. I'm simply trying to write to a file on an SD card. The library used is: FatFs - Generic FAT Filesystem Module R0.15 w/patch1. The code shown ...
user3430896's user avatar
1 vote
0 answers
29 views

PHP apache2 - php script cli will write txt file but browser will not

I'm running an Apache2 server (lamp) with PHP8.2 on Raspberry pi5. I have transferred all my code from a previous Pi4b. but installed the lamp server afresh. I have some simple php script files which ...
john murray's user avatar
0 votes
0 answers
24 views

recover.c CS50 blank images

I need help! I keep getting blank images when I run this code. I get all 50 images, so I know I screwed up with either fopen or fwrite, but I have spent hours with google bard and forums to no avail. ...
Tyler's user avatar
  • 1
1 vote
0 answers
67 views

Assertion failed - load matrix

typedef struct { size_t rows; size_t cols; size_t stride; float *es; } Mat; Mat t = mat_alloc(img_width*img_height, 3); Mat mat_alloc(size_t rows, size_t cols) { Mat m; m.rows ...
Botodach's user avatar
5 votes
1 answer
256 views

fwrite fails to write full (very large) buffer

I have a very large 8GB array of uint64_t that I need to write to file. For some reason, fwrite() only writes 290MB (exactly 305,131,520 bytes), then simply stops. My program is using a full core of ...
MrPuzzler's user avatar
  • 383
0 votes
0 answers
40 views

Laravel9 response()->stream() empty result with fwrite()

I need to export huge amount of data as csv string. So I tried to use fopen('php://stdout', w) with fwrite($file, $data). But Laravel response()->stream() do not return anything nor error. I have ...
Čamo's user avatar
  • 4,044
0 votes
1 answer
88 views

Why is fread being blocked when reading and copying a 0 bytes file?

I have a program that should copy files from one folder to another. But the function that reads the files is being blocked when the file have 0 bytes. When I do CTRL+C de program continues and copies ...
user20432234's user avatar

15 30 50 per page
1
2 3 4 5
119