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
3 answers

fwrite dynamic size

I am trying to print a dynamically downloaded image returned by cURL as shown : char *raw_image = malloc(1024); raw_image = doCurl("GET", img_url, NULL, NULL); printf("Content-Type: image/png\n\n"); fwrite(raw_image,…
user629034
  • 659
  • 2
  • 11
  • 30
0
votes
1 answer

Partial HTML formatted text being written

I have an interesting problem. I have the code below which takes $_POST['content'] and $_POST['page']. The 'content' im attempting to write is "HTML" (see below) however, the content that is being actually written is
0
votes
0 answers

Missing data after loading

I have the following structs: typedef struct PList { struct PList* next; Person value; } PList; typedef struct Person{ char name[100]; // Left as "" if empty Person PersonID ID; float amountOwed; }Person; typedef…
mangusbrother
  • 3,988
  • 11
  • 51
  • 103
0
votes
1 answer

How to work with memory like direct access files: analogues of fread and fwrite functions?

I need to work in my app with memory buffer like with direct access files. Is exists analogues for fread and fwrite functions? C++ I have buffer in memory with data. I want: read data, write data and move pointer in this buffer. Like files but with…
Robotex
  • 1,064
  • 6
  • 17
  • 41
0
votes
1 answer

fwrite writing only the first element and deleting all the following elements

this is my first question on this website. I have been making a C program for my college assignment. It's a game. I have used calloc to dynamically allocate memory for an array of structures. I am then reading from a file (which already has the same…
0
votes
3 answers

How to format the PHP output of a form action properly?

I will like to save the output of the following form action in a textfile like this: var1 var2 var3 Example form action:
Ting Ping
  • 1,145
  • 7
  • 18
  • 34
0
votes
2 answers

fwrite to delete a row in a file

Possible Duplicate: Remove Line From CSV File I have a file structured this way numbers1;numbers;numbers;\n numbers2;numbers;numbers;\n numbers3 to delete;numbers;numbers;\n numbers4;numbers;numbers;\n If I want to delete the row containing…
Mewster
  • 1,057
  • 3
  • 11
  • 21
0
votes
2 answers

Saving multiline strings that contain variables, into a file with PHP and CodeIgniter

I'm trying to save a multiline string, something like this in plain text: define host { use template; host_name $host_name; address 46.224.2.220; contacts …
Zim3r
  • 580
  • 2
  • 14
  • 36
0
votes
1 answer

PHP fwrite and NTFS logging on local server

If I fwrite 'w' a file on a Windows server with ntfs loggong (like my local xampp server), effectively overwriting it (vrs 'a' append), does the ntfs server secretly keep a historical copy of my old file somewhere on the hard drive? If so, can I…
dako
  • 41
  • 5
0
votes
1 answer

Variable contents from a file disappears and loop doesnt enter

I have the following code to read from a file, and write back to it after some computation. if(file_exists(CACHE_FILE_PATH)) { //read the cache and delete that line! $inp = array(); $cache = fopen(CACHE_FILE_PATH, 'r'); …
footy
  • 5,803
  • 13
  • 48
  • 96
0
votes
0 answers

fseek is unsuccessful in a binary file

edit Found out my problem. I didn't realize the only allowable values for the origin parameter of fseek are SEEK_SET SEEK_CUR and SEEK_END, so i changed my call to fseek(diskPointer, startOfData, SEEK_SET); I have a file open for reading and writing…
user1837165
  • 41
  • 1
  • 6
0
votes
3 answers

PHP- how do i retrieve value from javascript?

please help me with this. i have the following code that i can retrieve value from an external js file $phpBsetB= ""; echo $phpBsetB; lets assume that BsetB stores a string "abcde". the code above will simply…
user1865027
  • 3,505
  • 6
  • 33
  • 71
0
votes
1 answer

Using the get method to pass a string to a php code

I want to write a javascript string into a file called preview.html in my server. I am trying to use the Get method to pass the javascript string to php but it doesn't seem to be working. I am using aloha editor and the javascript string Result…
Jiyda Moussa
  • 925
  • 2
  • 9
  • 26
0
votes
2 answers

Having An Issue Backing Up MY Database From Php

the issue that I'm having is with the fopen(), fwrite(), and fclose() function. This is the error I am receiving: Warning: fopen(/db-backup-salisbury_school-20121128-021138.sql) [function.fopen]: failed to open stream: Permission denied in…
Mr. Hunt
  • 11
  • 1
0
votes
1 answer

Save encoded data in java to a file using php (java , php)

I want to send files data from Java to PHP and then the php saves the data to a file . here's my code : the java code : byte[] data=... str = new String(data,"ISO-8859-1"); //convert data to String . // send(str); and here's the php…
Walllzzz
  • 550
  • 1
  • 5
  • 16
1 2 3
99
100