Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7711977
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T01:30:47+00:00 2026-06-01T01:30:47+00:00

When I make a growing file in php, I usually use the _file_put_contents_ function

  • 0

When I make a growing file in php, I usually use the _file_put_contents_ function with FILE_APPEND and LOCK_EX flags.
Non, I have a growing video file that I play with mplayer.
To avoid that the file becomes too big, I want to overwrite data that I’ve already played without truncating the file. In bash, there is a simple function to do this:

dd if=/dev/zero of=myoutputfile conv=notrunc count=1 bs=128k

explained here http://en.wikipedia.org/wiki//dev/zero

Is there a way to obtain the same thing in php?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T01:30:48+00:00Added an answer on June 1, 2026 at 1:30 am

    How about this:

    $h = fopen("myoutput", "r+"); // '+' means also for writing without truncating
    fseek($h, $wherever_you_need);
    fwrite($h, $data); // overwrite
    fclose($h);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a growing number of scripts that make up a program I am
I have a table that is close to 20million records and growing. The table
I have an ASP.NET application in VS2008 that is growing larger and am developing
I have a small script that I use to resize all of the images
On windows, I have a dynamically created uncompressed avi video file which grows overtime.
make /bin/sh /Users/myusername/Downloads/php-5.3.5/ext/mssql/libtool --mode=compile cc -I. -I/Users/myusername/Downloads/php-5.3.5/ext/mssql -DPHP_ATOM_INC -I/Users/myusername/Downloads/php-5.3.5/ext/mssql/include -I/Users/myusername/Downloads/php-5.3.5/ext/mssql/main -I/Users/myusername/Downloads/php-5.3.5/ext/mssql -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM
Make it on Linux. The reason to use more than one version of Vim,
To make a JavaScript class with a public method I'd do something like: function
How can I make a textarea automatically expand using jQuery? I have a textbox
I have a ms sql server database with a growing number of stored procedures

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.