On Thu, 28 May 1998, Thomas Bushnell, n/BSG wrote:
>
> echo -n ""
>
> will issue a zero-length write syscall, which forces a file update.
No, you won't see that on the other afs-clients at least. The interesting
part is the open() call, which affects the content of the directory. Also,
it's more interesting to look at what is not said here, you probably do
'echo -n "">file', and the interesting part is the ">", which causes the
shell to do a open/write/close.
>
> A perl open/close with no writes is not the same thing, because it
> doesn't do any writes. Open for writing does not touch a file or its
> metadata in any way. Perl isn't doing anything clever...
Opening the file makes it show on the other afs-client immediately. Using
truss we see
erapbou@mackabee:perltest> truss -t open perl -e 'open (F,">x")'
[..deleted..]
open("x", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3
or am I misunderstanding you?
1) On one client...
erapbou@mackabee:perltest> rm j;perl -e 'sleep 3;print `date`;open
(F,">j");sleep 3;print `date`;print F "foofoofoo";sleep 5; print
`date`;close F'
Thu May 28 23:25:14 MET DST 1998
Thu May 28 23:25:17 MET DST 1998
Thu May 28 23:25:22 MET DST 1998
2) On another client...
erapbou@alken:perltest> rm b;while :; do sleep 1;date ;ls -l j; done
b: No such file or directory
Thu May 28 23:25:11 MET DST 1998
j: No such file or directory
Thu May 28 23:25:12 MET DST 1998
j: No such file or directory
Thu May 28 23:25:13 MET DST 1998
j: No such file or directory
Thu May 28 23:25:14 MET DST 1998
-rw-r--r-- 1 erapbou t 0 May 28 23:25 j
Thu May 28 23:25:16 MET DST 1998
-rw-r--r-- 1 erapbou t 0 May 28 23:25 j
Thu May 28 23:25:17 MET DST 1998
-rw-r--r-- 1 erapbou t 0 May 28 23:25 j
Thu May 28 23:25:18 MET DST 1998
-rw-r--r-- 1 erapbou t 0 May 28 23:25 j
Thu May 28 23:25:19 MET DST 1998
-rw-r--r-- 1 erapbou t 0 May 28 23:25 j
Thu May 28 23:25:20 MET DST 1998
-rw-r--r-- 1 erapbou t 0 May 28 23:25 j
Thu May 28 23:25:21 MET DST 1998
-rw-r--r-- 1 erapbou t 0 May 28 23:25 j
Thu May 28 23:25:22 MET DST 1998
-rw-r--r-- 1 erapbou t 0 May 28 23:25 j
Thu May 28 23:25:23 MET DST 1998
-rw-r--r-- 1 erapbou t 9 May 28 23:25 j
Thu May 28 23:25:24 MET DST 1998
-rw-r--r-- 1 erapbou t 9 May 28 23:25 j
This shows that the file is created and the status of the directory is
changed, so the server tells the other clients that are interested in that
directory. Then, when you write data into the file, that isn't sent to the
other clients until you close the file.
/Per
---
Per Boussard, KI/ERA/T/ED Office: +46 8 404 55 11
UNIX System Administrator Fax: +46 8 757 55 50
Ericsson Radio Systems AB Home: +46 8 570 349 67
S-164 80 STOCKHOLM, SWEDEN Email: [EMAIL PROTECTED]