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 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.

PHP fwrite

Visual Studio fwrite

C++ fwrite

1762 questions
0
votes
1 answer

fwrite append , appending before php end

i would like to store a string into a .php file,but as such , its a php script itself , in which i would like to add array(s),but so far i always append string like this but i would like to only add the content without opening…
Slytherin
  • 474
  • 3
  • 17
0
votes
1 answer

Using fwrite() to write from pointers

This question was asked quite a lot, but specifically in regards to structs containing pointers, and never helped my situation fully. What I'm trying to do, is strtok() the first and only command line argument based on the "|" character. For…
user2230096
  • 1
  • 1
  • 1
0
votes
3 answers

double free or corruption error when using fread in c++

So basically I was writing a test program to see if I could write and read a vector of queues into a binary file using fwrite and fread respectively. Even though the reading and writing part is done correctly and the values are correct, I get a…
Alex Oiko
  • 3
  • 1
0
votes
2 answers

PHP fwrite writing empty file

I'm trying to make this save a file and it creates the file, but it's always empty. This is the code for it:
Addison
  • 3,791
  • 3
  • 28
  • 48
0
votes
1 answer

Writing from console to text file, file data not saved

I am trying to save the content of the java console into a text file but each time I close the program the text file goes blank and rewrites to it. i.e. if I write to a file today, close the program and come back and run it again tomorrow, it has…
0
votes
2 answers

C fwrite() writes amount of characters doubled

When I use this code FILE *f = fopen(file, "wb"); fflush(f); if (f==NULL) { //perror(f); return 0; } else{ fwrite(text, sizeof(char), strlen(text), f); int i = fprintf(f, "%s", text); if (i>0) { fclose(f); return…
Chris Loonam
  • 5,735
  • 6
  • 41
  • 63
0
votes
2 answers

Edit file.php from controller using CodeIgniter

I need to add some content to a file from a controller in CodeIgniter, in my local enviroment I do this and works fine: $handle = fopen(APPPATH."config/file.php", "a+"); fwrite($handle, $stuff); fclose($handle); However the file doesn't seem to…
jonathanwiesel
  • 1,036
  • 2
  • 16
  • 35
0
votes
6 answers

Store variables in a certain format PHP

I'm trying to store data in a text file in a certain format. Here is the code: $value) { fwrite($handle,…
John Kee
  • 45
  • 1
  • 3
  • 10
0
votes
1 answer

newline and read from options to php file

I am currently working on writing to a textfile using php. There are two things that are not working well. The first is, that i cant jump a new line, tried many ways. The second thing is that i am unable to read the value from a selected options.…
DrWooolie
  • 7,637
  • 7
  • 20
  • 19
0
votes
1 answer

PHP File operations

NewPHP
  • 608
  • 2
  • 15
  • 28
0
votes
2 answers

Possible to write large XML file using cURL_setopt & PHP without fwrite?

I am having an almost identical problem to this one, posted in '09. It doesn't appear to be successfully solved, and I have been poring over related questions all day & implementing suggestions I have found. I am attempting to pull dynamic (changes…
Jane
  • 1
  • 6
0
votes
1 answer

fwrite() Isn't creating nor writing to a file that I specify it to

"LoggedIn" does = true and "CurrentUser" isn't "ManselD", yet it's still not writing or creating the file :( And yes my /accounts/logs folder is CHMOD 702 if(!$user == "ManselD"){ ini_set('date.timezone', 'Europe/London'); $ip =…
user1933361
0
votes
3 answers

writing error log but I'm not sure how to organize it

I have two functions doing preg_match to check if the emp# and the email is valid. If one or both is not valid it will be printed to an error.log but I want to organize it in a way humm....let me see if I know how to example as simple as…
Dora
  • 6,776
  • 14
  • 51
  • 99
0
votes
1 answer

Trying to read numbers from binary file ( fread,fwrite)

I'm trying to write numbers to a binary file and then read them back. But when i enter more then 13 numbers program stucks and dont show me results. here's my code : #include #include int main() { FILE *fp; int a[100], …
Lukas M.
  • 163
  • 1
  • 2
  • 13
0
votes
1 answer

files created by PHP deleted on exit

I am writing some files in the filesystem, but unfortunately these files are deleted at the exit of the PHP script. I have tried to create the files both with fopen (w+) and file_put_contents. Files are regularly deleted. Any ideas? EDIT: Files are…
fstab
  • 4,801
  • 8
  • 34
  • 66