FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Files getting clobbered when I run out of disk space
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Files getting clobbered when I run out of disk space [message #180111 is a reply to message #180106] Tue, 08 January 2013 18:01 Go to previous messageGo to previous message
Twayne is currently offline  Twayne
Messages: 135
Registered: September 2010
Karma:
Senior Member
In news:89d3884a-015f-42a7-910f-7c1c77ba68d9(at)googlegroups(dot)com,
faraz(at)squashclub(dot)org <faraz(at)squashclub(dot)org> typed:
> There was some disk space issues with my server. As a
> result any script
> I had that opened a file for writing would clobber it i.e
> truncate it to
> zero length . Since there was no space left on device,
> nothing would be
> written to it.
>
> Are there any workarounds to this? Here is some code I
> came up, but it is untested as I currently have disk
> space on my account:

If you mean at the server end, there is nothing you can do about
it. It's their responsibility to keep enough space available to
you.
If you mean a local server, then it's your responsibility.
Either get rid of any quota or get/move it to a larger/another
drive with enough space.

I can't really see the problem - or how it's occurrng. Perhaps if
you provided enough details ...

HTH,

Twayne`

> /////////////////////////////
>
> function check_disk_space() {
>
> global $home_dir;
>
> $fp = fopen( "$home_dir/cgi-bin/scripts/check_disk_space"
> , "w" );
>
> fwrite ($fp, 'hello world' ) || die_sub ( 'Error
> checking for disk space' );
>
> fclose ($fp) || die_sub ( 'Error checking for disk space'
> );
>
> // unlink ( 'check_disk_space' );
>
> } // end function
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: does the php is not popular?i am a phper?
Next Topic: shell script with shell_exec()
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Sep 19 17:13:42 GMT 2024

Total time taken to generate the page: 0.05300 seconds