9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] zero-length writes with rc
@ 2004-02-09 22:12 andrey mirtchovski
  2004-02-09 22:22 ` Bruce Ellis
  2004-02-10  0:08 ` rob pike, esq.
  0 siblings, 2 replies; 4+ messages in thread
From: andrey mirtchovski @ 2004-02-09 22:12 UTC (permalink / raw)
  To: 9fans

how do I make a zero-length write in an rc script?  wikifs uses
zero-length write as a signal to 'commit' information about a wiki
page...

andrey



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] zero-length writes with rc
  2004-02-09 22:12 [9fans] zero-length writes with rc andrey mirtchovski
@ 2004-02-09 22:22 ` Bruce Ellis
  2004-02-09 22:31   ` andrey mirtchovski
  2004-02-10  0:08 ` rob pike, esq.
  1 sibling, 1 reply; 4+ messages in thread
From: Bruce Ellis @ 2004-02-09 22:22 UTC (permalink / raw)
  To: 9fans

echo -n

----- Original Message -----
From: "andrey mirtchovski" <mirtchov@cpsc.ucalgary.ca>
To: <9fans@cse.psu.edu>
Sent: Tuesday, February 10, 2004 9:12 AM
Subject: [9fans] zero-length writes with rc


> how do I make a zero-length write in an rc script?  wikifs uses
> zero-length write as a signal to 'commit' information about a wiki
> page...
>
> andrey



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] zero-length writes with rc
  2004-02-09 22:22 ` Bruce Ellis
@ 2004-02-09 22:31   ` andrey mirtchovski
  0 siblings, 0 replies; 4+ messages in thread
From: andrey mirtchovski @ 2004-02-09 22:31 UTC (permalink / raw)
  To: 9fans

> echo -n

thought of that, but unfortunately it has to be done on the same fid
as the rest, so something like this won't work:

	echo 'datadatadata' > file
	echo -n >> file

(the second echo opens up a new transaction)

oh, got it:

	{ echo 'datadatadata'; echo -n } > file

seems to work :)

thanx

(sorry, writing as I go...)



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] zero-length writes with rc
  2004-02-09 22:12 [9fans] zero-length writes with rc andrey mirtchovski
  2004-02-09 22:22 ` Bruce Ellis
@ 2004-02-10  0:08 ` rob pike, esq.
  1 sibling, 0 replies; 4+ messages in thread
From: rob pike, esq. @ 2004-02-10  0:08 UTC (permalink / raw)
  To: 9fans

a direct way is
	syscall write 1 0 buf 2>/dev/null

echo -n works, too, but it's not obvious.

-rob



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-02-10  0:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-09 22:12 [9fans] zero-length writes with rc andrey mirtchovski
2004-02-09 22:22 ` Bruce Ellis
2004-02-09 22:31   ` andrey mirtchovski
2004-02-10  0:08 ` rob pike, esq.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).