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

file_put_contents duplicating content

I am using file_put_contents writing to a file and I'm getting duplicate content ... written 2x and 1x litura file_put_contents($_SERVER['DOCUMENT_ROOT'].'/test/test.tmp', '1 ', FILE_APPEND); contents of test.tmp 11 already restarted apache and I…
Papa Charlie
  • 625
  • 8
  • 31
0
votes
3 answers

Writing to an output file in C

I am writing a program in C that takes a a command line argument that represents the name of an output file. I then opened the file to write to it. The problem is that when I write something in the command line, it never shows up in the file I was…
Kalmar
  • 195
  • 2
  • 18
0
votes
2 answers

PHP4 problems with include() within a file created by fwrite()

I have a file called generator.php that uses fwrite() to create a result.php on the server (Apache, PHP4). One of the lines in result.php is a PHP include() statement. So, in generator.php: if (!is_file($fname)){ $resultfile =…
Pranab
  • 2,207
  • 5
  • 30
  • 50
0
votes
2 answers

PHP fwrite over-riding whole file

Okay so basically the script works, but every time i refresh the data.txt file is over-written, i want it to add each individual entry into the data.txt in a new file. example: 1.1.1.1 July 18th @ 2:03:17…
0
votes
2 answers

Database or file record keeping - php

I am creating a record system for my site which will track users and how they interact with my site's pages. This system will record button clicks, page view times, and the method used to navigate away from a page (among other things.) I an…
Hoytman
  • 1,722
  • 2
  • 17
  • 29
0
votes
1 answer

Exception writing data into a new file

My task is to read a yuv file and to each component(Y,Cb,Cr) of it, I'm appending some data and storing it into another file. I have tried the below code: #include #include void main() { FILE…
Zax
  • 2,870
  • 7
  • 52
  • 76
0
votes
1 answer

Delete (unlink) or Create (fwrite) file with PHP when file is in use

I am running a website with a LAMP system. Contents come from a database. For caching purposes, I create files on my webserver (containing cachable contents) (via fwrite()). Every once in a while I am deleting the cache files (via unlink()). File…
Sebastian
  • 471
  • 1
  • 10
  • 26
0
votes
2 answers

How do I write on a file without clean it?

How do I write on a file without clean the file using fwrite function? I would like to write skiping a line using fwrite in a text file. $fp = fopen('somefile.txt', 'w'); fwrite($fp, "Some text"); fwrite($fp,"More texto in another line"); …
user2555499
  • 3
  • 1
  • 2
0
votes
2 answers

Writing to file based on array value

I have created an array which contains; The filepath where the item is to be written. the contents that I wish to be written to the file The code for my array is: foreach ($NewLang as $row => $val) { $writefile = implode(",", $val); …
0
votes
3 answers

Write PHP files through a PHP file from records in a mySQL database

The previous solutions working with MS Access did not pan out so I am trying this time with php. I have this php file that opens a database, reads a list of records and creates an html file for each record, in their respective folder name (folder…
Luis
  • 15
  • 1
  • 6
0
votes
1 answer

Problems with fread and fwrite

I'm having some problems with a program that uses fwrite and fread -> fread (void*, size_t, size_t, FILE*);, when a set second size_t as any number different than zero it doesn't works. Here is the code; it doesn't works this way, if anyone could…
user2536075
  • 3
  • 1
  • 2
0
votes
3 answers

fread fwrite fseek in C

Hello what i am trying to do is to reverse a binary file. The type of the file is wav so for example if the channel number is 2 and bits per sample are 16 each time i will copy 32/8 = 4 bytes. The first think to do is copy the header as it is(that…
captain monk
  • 719
  • 4
  • 11
  • 34
0
votes
1 answer

fopen(), sleep(2), fwrite(), fgets() returns false response (POST Request) PHP

I want to POST $data to $url after it has connected for 2 seconds. But it does not work. Where's the problem? Like this it returns the normal site. //$url is set above to http://www.putlocker.com/file/CB79E6201EDBA3ED //$hash variable is set above…
iCode
  • 1,456
  • 1
  • 15
  • 26
0
votes
3 answers

strip slashes in php linux

I want to ask a very simple question. I am working on a project in which I have entered a code, say I am entering a code like : On click of a save button, This code is being saved into a php file say testfile.php. When I am…
Rohitashv Singhal
  • 4,517
  • 13
  • 57
  • 105
0
votes
1 answer

I'm writing to a csv file with htmlspecialchars(), when reading from the csv I special chars are viewed without escaping

When I'm writing to "Text.csv" the string: ' my name is "Robert" ', the string that is added to Text.csv looks like: my name is /"Robert/" ' . In my code, before writing to the csv file, the $_POST var is being escaped with the php function…
Tzahi Serruya
  • 147
  • 2
  • 11