xfs
[Top] [All Lists]

Re: is the flush-on-close-after-truncate still needed?

To: DS <xfs@xxxxxxxxxxxx>
Subject: Re: is the flush-on-close-after-truncate still needed?
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Thu, 26 Jun 2008 16:24:42 -0500
Cc: xfs@xxxxxxxxxxx
In-reply-to: <486407EB.70703@xxxxxxxxxxx>
References: <4859415B.3000009@xxxxxxxxxxx> <200806181049.07812.dchinner@xxxxxxxxx> <20080626210904.GA15920@xxxxxxxxxxxx> <486407EB.70703@xxxxxxxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Thunderbird 2.0.0.14 (X11/20080501)
Eric Sandeen wrote:
> DS wrote:
>> Hmm, but file overwrite in perl/php is slow, very slow.
> 
> If you have control over your perl/php, perhaps you can change it to do
> unlink/create/write instead of truncate/write?

Or even:

--- test.perl.orig        2008-06-26 16:22:48.163869293 -0500
+++ test.perl   2008-06-26 16:23:25.426869060 -0500
@@ -3,7 +3,7 @@
 $time=time();
 for ($i=1;$i<100;$i++)
 {
-open (SUBOR,">$i.txt");
+open (SUBOR,"+<$i.txt");
 print SUBOR "aaaaaaaaaaaaaaaaaaa\n";
 close (SUBOR);
 print "WRITE $i. FILE\n";

which gives you RW access, but does not do the truncate.

Or use sysopen.  Or ...

-Eric


<Prev in Thread] Current Thread [Next in Thread>