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

when php fwrite large string on network drive, puts junk or missing part

My php script needs to write text file, (actualy write php code), in order to include it on the next run. So I have all my data (arrays) from the previus run, with out the use of database. The files are saved on a network drive (SAN). The script…
0
votes
1 answer

Creating a PDF. How can I get this working? Errors populating

Below is my php script that parses data and returns it on a webpage. I've attempted to integrate code with the TCPDF library, but I can't seem to get it to work. I'd like to generate a pdf file that automatically saves to my desktop. Here is my…
ValleyDigital
  • 1,460
  • 4
  • 21
  • 37
0
votes
1 answer

What errors do I have in my php code to create a new directory and then save a file in that new directory

So, I have been trying to de bug my code for hours now, and I whilst I am not a developer, and very novice to php, I cannot find my syntax or logic error: In general, I am trying to develop a code that will create a new directory based upon some…
brian-welch
  • 441
  • 1
  • 7
  • 19
0
votes
2 answers

Open an XML file and replace a specific character in it using PHP

Currently I have an XML file <Folder…
user1871516
  • 979
  • 6
  • 14
  • 26
0
votes
1 answer

PHP: invert/reverse file line order when include()d OR when writting with fwrite

I have created a small module that allows users to add small messages when entering a webpage. For that, it writes them down into a html document (msg.html) and later in the page I include() it into a div. My biggest problem is that I don't know how…
MoeSzislak
  • 137
  • 1
  • 4
  • 13
0
votes
2 answers

why does this code work without an fwrite statement?

I am trying to understand curl/fopen in PHP. the Following function works fine, but I expected at some point to see fwrite. function cURLdownload($url, $file) { if( !cURLcheckBasicFunctions() ) return "UNAVAILABLE: cURL Basic Functions"; $ch…
DogBot
  • 528
  • 1
  • 6
  • 15
0
votes
1 answer

Writing to a file and loading content / suggestions-like

I have the code to a simple form page. It writes to a file and loads the content with include() but it doesn't work. Any of you could tell me where am I mistaken? The error is that it doesn't write down to the file anything at all, the form submits…
MoeSzislak
  • 137
  • 1
  • 4
  • 13
0
votes
2 answers

Variables not being fwritten

I've been trying to create a form that creates a ticket in the form of HTML to easily organize things and view the issue, however every time I try to test this, it only shows the variable as $variable here is the script that I am using in order to…
0
votes
2 answers

PHP String Comparison not working as expected

I have the following snippet of code that I am trying to use to read a file that can have some lines repeated two or more times. The goal of this script is to only write unique lines (no duplicates) but for some reason it appears that it is not…
pogeybait
  • 3,065
  • 2
  • 21
  • 23
0
votes
1 answer

Using fwrite in Visual C++ 2005

I'm used to using fwrite to write the contents of a buffer to a file in gcc. However, for some reason, fwrite doesn't seem to work correctly in Visual C++ 2005. What I'm doing now is to convert a text file into binary. The program worked fine for…
Rayne
  • 14,247
  • 16
  • 42
  • 59
0
votes
2 answers

PHP - Write text file content in another text file

I want to check if the content of a text file is the same as another, and if it isn't, write one into the other. My code is as follows:
fpolloa
  • 99
  • 4
  • 13
0
votes
0 answers

Issue with file I/O on android

I met a problem recently. I need to write some tmp data to the file(use API fwrite) in /data/data/com../tmp on Android. The test program just run on one thread. and write data several hundred KB one time. case 1: In this case, I create 2 file in…
Dannyfly
  • 1
  • 1
0
votes
1 answer

Writing data to .cof file

I'm very new to coding and have been utterly baffled (for the second time today) by something google can't fix. I am writing code using Code Composer 4 on Windows. My code has no errors but the fopen("coffic.cof", "w") just doesn't change the data…
Ivo Johansen
  • 9
  • 1
  • 1
  • 2
0
votes
0 answers

fwrite() function erase .txt file but do not write in it

I'm stuck with a problem fwrite() in PHP. I'm using Raspberry Pi with running server on it Apache2. This code works perfectly on Windows. The problem is that I cannot write anything to the file. The code just erase everything what is in file and…
user2332502
  • 3
  • 1
  • 2
0
votes
1 answer

PHP: "Hot" File Write or sqlite

Does PHP provide an option to keep a file open instead of re-opening whenever the script is started? My script is called around 500 times per second and can be compared to a counter script, which reads 100 lines from the file status.json, does some…
ledy
  • 1,527
  • 6
  • 22
  • 33