NFS write() calls lead to read() calls?

Ivan Voras ivoras at fer.hr
Wed Mar 28 16:04:03 UTC 2007


Ulrich Spoerlein wrote:

> What kind of C program or script did you have in mind? My C-foo is very 
> weak ...

If you have python installed, this is a simple way:

----
print "writing"
f = file("a_file", "w")
for x in xrange(1024): # write 1024 MB
     f.write(' '*1024*1024)
f.close()

raw_input("press enter to rewrite")

print "rewriting"
f = file("a_file", "r+")
for x in xrange(1024): # write 1024 MB again
     f.write(' '*1024*1024)
f.close()
----

save it to a file, run the file with python interpreter. If you don't 
observe the weird read-before-write effect, then it's not a problem in 
FreeBSD / NFS.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20070328/fb69c70b/signature.pgp


More information about the freebsd-current mailing list