9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] tip o' the day
@ 2005-02-08  8:05 Russ Cox
  2005-02-08  8:07 ` [9fans] " Russ Cox
                   ` (10 more replies)
  0 siblings, 11 replies; 32+ messages in thread
From: Russ Cox @ 2005-02-08  8:05 UTC (permalink / raw)
  To: 9fans

I was debugging a program with Nashi just now
and he was surprised to find out about snap and
snapfs.

What surprises do you wish someone had told you about?

Russ

P.S. If you keep them to one line, maybe I'll make an
alternate fortune file so you can put
   fortune /sys/lib/plan9.tips
or something in your profile.


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

* [9fans] Re: tip o' the day
  2005-02-08  8:05 [9fans] tip o' the day Russ Cox
@ 2005-02-08  8:07 ` Russ Cox
  2005-02-08  8:16 ` [9fans] " Tim Newsham
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 32+ messages in thread
From: Russ Cox @ 2005-02-08  8:07 UTC (permalink / raw)
  To: 9fans

> What surprises do you wish someone had told you about?

I'll start.

Use getcallerpc(2) to record a function's caller for debugging.

Russ


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

* Re: [9fans] tip o' the day
  2005-02-08  8:05 [9fans] tip o' the day Russ Cox
  2005-02-08  8:07 ` [9fans] " Russ Cox
@ 2005-02-08  8:16 ` Tim Newsham
  2005-02-08  9:41 ` Fco. J. Ballesteros
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 32+ messages in thread
From: Tim Newsham @ 2005-02-08  8:16 UTC (permalink / raw)
  To: Russ Cox, Fans of the OS Plan 9 from Bell Labs

> What surprises do you wish someone had told you about?

   fn cd { builtin cd $* && awd $sysname }

but that should be in the standard distribution now.  I'm
sure there are more, but I can't remember them now.

> Russ

Tim N.


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

* Re: [9fans] tip o' the day
  2005-02-08  8:05 [9fans] tip o' the day Russ Cox
  2005-02-08  8:07 ` [9fans] " Russ Cox
  2005-02-08  8:16 ` [9fans] " Tim Newsham
@ 2005-02-08  9:41 ` Fco. J. Ballesteros
  2005-02-08  9:58   ` Steve Simon
  2005-02-08 12:08   ` Robert Raschke
  2005-02-08  9:51 ` Steve Simon
                   ` (7 subsequent siblings)
  10 siblings, 2 replies; 32+ messages in thread
From: Fco. J. Ballesteros @ 2005-02-08  9:41 UTC (permalink / raw)
  To: russcox, 9fans

[-- Attachment #1: Type: text/plain, Size: 127 bytes --]

you can use stub(8) to provide file mount points.
/sys/src/cmd/unix/winplumb lets you plumb to a windows navigator

thanks

[-- Attachment #2: Type: message/rfc822, Size: 2994 bytes --]

From: Russ Cox <russcox@gmail.com>
To: 9fans <9fans@cse.psu.edu>
Subject: [9fans] tip o' the day
Date: Tue, 8 Feb 2005 03:05:20 -0500
Message-ID: <ee9e417a050208000537d60bcf@mail.gmail.com>

I was debugging a program with Nashi just now
and he was surprised to find out about snap and
snapfs.

What surprises do you wish someone had told you about?

Russ

P.S. If you keep them to one line, maybe I'll make an
alternate fortune file so you can put
   fortune /sys/lib/plan9.tips
or something in your profile.

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

* Re: [9fans] tip o' the day
  2005-02-08  8:05 [9fans] tip o' the day Russ Cox
                   ` (2 preceding siblings ...)
  2005-02-08  9:41 ` Fco. J. Ballesteros
@ 2005-02-08  9:51 ` Steve Simon
  2005-02-08 16:31   ` Ronald G. Minnich
  2005-02-08 10:01 ` Catalin(ux aka Dino) BOIE
                   ` (6 subsequent siblings)
  10 siblings, 1 reply; 32+ messages in thread
From: Steve Simon @ 2005-02-08  9:51 UTC (permalink / raw)
  To: russcox, 9fans

> alternate fortune file so you can put
>    fortune /sys/lib/plan9.tips

Though I thing learning more is "a good thing", I cannot
help but get an image of a paperclip poping up to give me the tip...

-Steve


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

* Re: [9fans] tip o' the day
  2005-02-08  9:41 ` Fco. J. Ballesteros
@ 2005-02-08  9:58   ` Steve Simon
  2005-02-08 12:08   ` Robert Raschke
  1 sibling, 0 replies; 32+ messages in thread
From: Steve Simon @ 2005-02-08  9:58 UTC (permalink / raw)
  To: 9fans

my bad, I meant to offer one

Add this rule to $home/lib/plumbing:

	type is text
	data matches 'Local (.*)'
	plumb to none
	plumb start rc -c $1

so you can attach a remote file server "behind" rio,
IE in all rio windows:

	term% plumb 'Local 9fs machine'

-Steve


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

* Re: [9fans] tip o' the day
  2005-02-08  8:05 [9fans] tip o' the day Russ Cox
                   ` (3 preceding siblings ...)
  2005-02-08  9:51 ` Steve Simon
@ 2005-02-08 10:01 ` Catalin(ux aka Dino) BOIE
  2005-02-08 11:01   ` Charles Forsyth
  2005-02-08 15:46 ` andrey mirtchovski
                   ` (5 subsequent siblings)
  10 siblings, 1 reply; 32+ messages in thread
From: Catalin(ux aka Dino) BOIE @ 2005-02-08 10:01 UTC (permalink / raw)
  To: Russ Cox, Fans of the OS Plan 9 from Bell Labs

On Tue, 8 Feb 2005, Russ Cox wrote:

> I was debugging a program with Nashi just now
> and he was surprised to find out about snap and
> snapfs.
>
> What surprises do you wish someone had told you about?
>
> Russ
>
> P.S. If you keep them to one line, maybe I'll make an
> alternate fortune file so you can put
>   fortune /sys/lib/plan9.tips
> or something in your profile.

Good idea!

P.S. What is the CTRL+C key combination?

---
Catalin(ux aka Dino) BOIE
catab at deuroconsult.ro
http://kernel.umbrella.ro/


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

* Re: [9fans] tip o' the day
  2005-02-08 10:01 ` Catalin(ux aka Dino) BOIE
@ 2005-02-08 11:01   ` Charles Forsyth
  2005-02-08 11:04     ` Catalin(ux aka Dino) BOIE
  0 siblings, 1 reply; 32+ messages in thread
From: Charles Forsyth @ 2005-02-08 11:01 UTC (permalink / raw)
  To: 9fans

>P.S. What is the CTRL+C key combination?

Delete.  it was possibly more appropriate when it was labelled `RUBOUT',
as in `get the boys to rub out those processes'.


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

* Re: [9fans] tip o' the day
  2005-02-08 11:01   ` Charles Forsyth
@ 2005-02-08 11:04     ` Catalin(ux aka Dino) BOIE
  0 siblings, 0 replies; 32+ messages in thread
From: Catalin(ux aka Dino) BOIE @ 2005-02-08 11:04 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On Tue, 8 Feb 2005, Charles Forsyth wrote:

>> P.S. What is the CTRL+C key combination?
>
> Delete.  it was possibly more appropriate when it was labelled `RUBOUT',
> as in `get the boys to rub out those processes'.

Thanks!

---
Catalin(ux aka Dino) BOIE
catab at deuroconsult.ro
http://kernel.umbrella.ro/


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

* Re: [9fans] tip o' the day
  2005-02-08  9:41 ` Fco. J. Ballesteros
  2005-02-08  9:58   ` Steve Simon
@ 2005-02-08 12:08   ` Robert Raschke
  1 sibling, 0 replies; 32+ messages in thread
From: Robert Raschke @ 2005-02-08 12:08 UTC (permalink / raw)
  To: 9fans

To build a kernel as a mere mortal user (a bit too long for the one
line restriction):

mkdir -p $home/src/kernel/ ^ (pc boot ip port)
for (i in pc boot ip port) {
	bind -c $home/src/kernel/$i $home/src/kernel/$i
	bind -a /sys/src/9/$i $home/src/kernel/$i
}
cd $home/src/kernel/pc
mk 'CONF=pccpuf'

The only thing that irks me with this ever so slightly, is the fact
that in order to make actual changes to existing files in /sys/..., I
need to copy them into my own directory before doing the binding.

Robby



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

* Re: [9fans] tip o' the day
  2005-02-08  8:05 [9fans] tip o' the day Russ Cox
                   ` (4 preceding siblings ...)
  2005-02-08 10:01 ` Catalin(ux aka Dino) BOIE
@ 2005-02-08 15:46 ` andrey mirtchovski
  2005-02-08 16:29 ` Ronald G. Minnich
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 32+ messages in thread
From: andrey mirtchovski @ 2005-02-08 15:46 UTC (permalink / raw)
  To: 9fans

i humbly offer this as contribution:

	http://pages.cpsc.ucalgary.ca/~mirtchov/lanlp9/tips.html

these tips were laboriously assembled by dean prichard and company at
LANL in their Plan 9 days.  i'm only hosting it.

pick and choose what you feel is of value.

andrey



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

* Re: [9fans] tip o' the day
  2005-02-08  8:05 [9fans] tip o' the day Russ Cox
                   ` (5 preceding siblings ...)
  2005-02-08 15:46 ` andrey mirtchovski
@ 2005-02-08 16:29 ` Ronald G. Minnich
  2005-02-08 17:31 ` Sam
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 32+ messages in thread
From: Ronald G. Minnich @ 2005-02-08 16:29 UTC (permalink / raw)
  To: Russ Cox, Fans of the OS Plan 9 from Bell Labs



On Tue, 8 Feb 2005, Russ Cox wrote:

> What surprises do you wish someone had told you about?

if you want to watch how 9p works between client and server, man iostats

It's worth your time to find out what the '1' attribute is on a file



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

* Re: [9fans] tip o' the day
  2005-02-08  9:51 ` Steve Simon
@ 2005-02-08 16:31   ` Ronald G. Minnich
  0 siblings, 0 replies; 32+ messages in thread
From: Ronald G. Minnich @ 2005-02-08 16:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs; +Cc: russcox



On Tue, 8 Feb 2005, Steve Simon wrote:

> Though I thing learning more is "a good thing", I cannot help but get an
> image of a paperclip poping up to give me the tip...

glenda with a chainsaw works for me.

ron


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

* Re: [9fans] tip o' the day
  2005-02-08  8:05 [9fans] tip o' the day Russ Cox
                   ` (6 preceding siblings ...)
  2005-02-08 16:29 ` Ronald G. Minnich
@ 2005-02-08 17:31 ` Sam
  2005-02-08 18:22   ` Heiko Dudzus
  2005-02-08 19:13 ` Micah Stetson
                   ` (2 subsequent siblings)
  10 siblings, 1 reply; 32+ messages in thread
From: Sam @ 2005-02-08 17:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> What surprises do you wish someone had told you about?

The -[sS] flags to /acme/mail/Mail.


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

* Re: [9fans] tip o' the day
  2005-02-08 17:31 ` Sam
@ 2005-02-08 18:22   ` Heiko Dudzus
  0 siblings, 0 replies; 32+ messages in thread
From: Heiko Dudzus @ 2005-02-08 18:22 UTC (permalink / raw)
  To: 9fans

>> What surprises do you wish someone had told you about?
>
> The -[sS] flags to /acme/mail/Mail.

Nice, yes, nice.
:)



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

* Re: [9fans] tip o' the day
  2005-02-08  8:05 [9fans] tip o' the day Russ Cox
                   ` (7 preceding siblings ...)
  2005-02-08 17:31 ` Sam
@ 2005-02-08 19:13 ` Micah Stetson
  2005-02-08 19:37   ` rog
  2005-02-16 19:17   ` McLone
  2005-02-10  7:21 ` Vincent van Gelderen
  2005-02-15 15:33 ` andrey mirtchovski
  10 siblings, 2 replies; 32+ messages in thread
From: Micah Stetson @ 2005-02-08 19:13 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

bind -c /n/unix/some/awfully/long/path/name /n/shorter

Use files named guide for per-project scratch space in acme.

I'm not sure that's the best one-liner for what I mean.  I used to use
directory windows and unnamed windows made with 'New' for scratch
space in Acme.  Now I create a guide file for the project I'm working
on and use it for temporary notes, commands, and the names of files
that I'm working with.  The commands get an appropriate working
directory, the notes get some context (i.e. what project they go
with), and I don't get warned to save the file when I exit, but I can
still save it if I want to.

Micah


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

* Re: [9fans] tip o' the day
  2005-02-08 19:13 ` Micah Stetson
@ 2005-02-08 19:37   ` rog
  2005-02-08 19:54     ` andrey mirtchovski
  2005-02-15 14:11     ` Matthias Teege
  2005-02-16 19:17   ` McLone
  1 sibling, 2 replies; 32+ messages in thread
From: rog @ 2005-02-08 19:37 UTC (permalink / raw)
  To: 9fans

> bind -c /n/unix/some/awfully/long/path/name /n/shorter

this is even better with mntgen, "global-mutable namespace" hack
(or is it a hack?) and the Local plumb trick mentioned earlier:

(in $home/lib/profile):
	mntgen
	srvfs plumbspace /n
	plumber
	rfork n
	mount -b /srv/plumbspace /n

a little shell script, "local" completes the picture:
	#!/bin/rc
	plumb 'Local ' ^ $"*

then i can do:

	local bind -c /n/unix/some/awfully/long/path/name /n/anything

and /n/anything is immediately visible everywhere (including
in cpu'd shells under /mnt/term) and i can plumb files in it
without any further hassle.

the use of mntgen means that i don't have to restrict myself to
previously existing names.

this is great when constantly dealing with namespaces that
come and go (and particularly since i can import namespaces
directly from Inferno, which means it's easy to gateway across
to Windows machines).



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

* Re: [9fans] tip o' the day
  2005-02-08 19:37   ` rog
@ 2005-02-08 19:54     ` andrey mirtchovski
  2005-02-09 16:29       ` Ronald G. Minnich
  2005-02-15 14:11     ` Matthias Teege
  1 sibling, 1 reply; 32+ messages in thread
From: andrey mirtchovski @ 2005-02-08 19:54 UTC (permalink / raw)
  To: 9fans

my personal favourite, which i can't live without is the function to start
acme mail in its own rio window (i don't share it with my main acme editor):

it contains my favourite fonts here, but you can make your own file by
starting Mail and issuing a 'Dump' command, then cp-ing acme.dump to
acmemail.dump:

 	plan9% cat /env/'fn#amail'
 	fn amail {acme -l $home^/acmemail.dump}
 	plan9% cat $home/acmemail.dump
 	/usr/andrey
 	/lib/font/bit/10646/7x13/7x13.font
 	/lib/font/bit/10646/7x13/7x13.font
 	          0
 	e          0           0           0           0           1
 	          1          49         143           0           0 /mail/fs/mbox/ Del Snarf | Look Put Mail Delmesg
 	/acme/mail
 	Mail mbox
 	plan9%

andrey


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

* Re: [9fans] tip o' the day
  2005-02-08 19:54     ` andrey mirtchovski
@ 2005-02-09 16:29       ` Ronald G. Minnich
  0 siblings, 0 replies; 32+ messages in thread
From: Ronald G. Minnich @ 2005-02-09 16:29 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

yikes! These tip of the day things are amazing!

This is so good it seems like it to be on the wiki as well?

ron



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

* Re: [9fans] tip o' the day
  2005-02-08  8:05 [9fans] tip o' the day Russ Cox
                   ` (8 preceding siblings ...)
  2005-02-08 19:13 ` Micah Stetson
@ 2005-02-10  7:21 ` Vincent van Gelderen
  2005-02-10  7:40   ` Tim Newsham
  2005-02-15 15:33 ` andrey mirtchovski
  10 siblings, 1 reply; 32+ messages in thread
From: Vincent van Gelderen @ 2005-02-10  7:21 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

fn c {history -D /$1}

(so you can paste the output of
replica/pull somewhere.)

Cheers,
	Vincent


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

* Re: [9fans] tip o' the day
  2005-02-10  7:21 ` Vincent van Gelderen
@ 2005-02-10  7:40   ` Tim Newsham
  2005-02-10 14:59     ` Russ Cox
  0 siblings, 1 reply; 32+ messages in thread
From: Tim Newsham @ 2005-02-10  7:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Here are some simple shortcuts I find useful during development.

fn f { du -a $* | sed 's/^.*	//g' }    <-- that whitespace is a tab
 	Tree enumerator (simple "find") useful for many purposes

fn s { lc *.[chsyl] }
 	List out the sources in the current directory.  Similar
 	to an example in the rc paper if I remember correctly.

fn gn { grep -n $* /dev/null }
 	Grep, but force listing of filename:lineno so you
 	can click on an entry to jump to it in an editor.

fn g { grep -n $* *.[chsyl] /dev/null }
 	gn on all sources in the current directory

(how about a plumber command that ran grep -n on the files
in the current directory and the include directory?  Then
you could plumb words to it in acme with mouse chording to
quickly crossreference keywords in the src tree.  I tried
goofing with that once but failed pretty miserably).

Tim N.


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

* Re: [9fans] tip o' the day
  2005-02-10  7:40   ` Tim Newsham
@ 2005-02-10 14:59     ` Russ Cox
  2005-02-10 19:16       ` Tim Newsham
  0 siblings, 1 reply; 32+ messages in thread
From: Russ Cox @ 2005-02-10 14:59 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> fn gn { grep -n $* /dev/null }
>         Grep, but force listing of filename:lineno so you
>         can click on an entry to jump to it in an editor.
>
> fn g { grep -n $* *.[chsyl] /dev/null }
>         gn on all sources in the current directory

rob and i use this as /bin/g.  it handles both of these:

% cat /bin/g
#!/bin/rc

flags=()
while(! ~ $#* 1 && ~ $1 -* && ! ~ $1 --){
	flags=($flags $1);
	shift
}
if(~ $1 --)
	shift

switch($#*){
case 0
	echo 'usage: g [flags] pattern [files]' >[1=2]
	exit usage
case 1
	pattern=$1
	files=(`{ls *.[bcChm] *.cc *.py *.tex *.ms *.java >[2]/dev/null})
case *
	pattern=$1
	shift
	files=($*)
}
grep -n $flags -- $pattern $files /dev/null
%

> (how about a plumber command that ran grep -n on the files
> in the current directory and the include directory?  Then
> you could plumb words to it in acme with mouse chording to
> quickly crossreference keywords in the src tree.  I tried
> goofing with that once but failed pretty miserably).

i don't see why you'd involve the plumber.  just write
a script.

i find i almost never want to grep both local files and
/sys/include.  i either run g or sig.

% sig memmove
	void* memmove(void *s1, void *s2, long n)
%

russ


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

* Re: [9fans] tip o' the day
  2005-02-10 14:59     ` Russ Cox
@ 2005-02-10 19:16       ` Tim Newsham
  0 siblings, 0 replies; 32+ messages in thread
From: Tim Newsham @ 2005-02-10 19:16 UTC (permalink / raw)
  To: Russ Cox, Fans of the OS Plan 9 from Bell Labs

> % sig memmove
> 	void* memmove(void *s1, void *s2, long n)

Ahh, there's a "wish someone had told me earlier" right there!
(Also the "src" command).  Although this doesnt get me everything
that I get from grepping ("sig OREAD" and "sig Disk" dont get
me information about OREAD or struct Disk).

> russ

Tim N.


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

* Re: [9fans] tip o' the day
  2005-02-08 19:37   ` rog
  2005-02-08 19:54     ` andrey mirtchovski
@ 2005-02-15 14:11     ` Matthias Teege
  2005-02-15 15:29       ` rog
  1 sibling, 1 reply; 32+ messages in thread
From: Matthias Teege @ 2005-02-15 14:11 UTC (permalink / raw)
  To: 9fans

> (in $home/lib/profile):
> 	mntgen
> 	srvfs plumbspace /n
> 	plumber
> 	rfork n
> 	mount -b /srv/plumbspace /n

I don't understand it completly. After that, I try

% 9fs unixbox
% ls /n/unixbox

and get nothing. My profile looks like this

case terminal
	mntgen
	srvfs plumbspace /n
	plumber
	rfork n
	mount -b /srv/plumbspace /n
	upas/fs
	echo -n accelerated > '#m/mousectl'
	echo -n 'res 3' > '#m/mousectl'
	prompt=('term% ' '	')
	fn term%{ $* }
	exec rio -i riostart

What is my mistake? Do I need to mount the unixboxes before lib/profile?

Matthias



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

* Re: [9fans] tip o' the day
  2005-02-15 14:11     ` Matthias Teege
@ 2005-02-15 15:29       ` rog
  2005-02-15 16:57         ` Matthias Teege
  0 siblings, 1 reply; 32+ messages in thread
From: rog @ 2005-02-15 15:29 UTC (permalink / raw)
  To: 9fans

Matthias:
> > 	mntgen
> > 	srvfs plumbspace /n
> > 	plumber
> > 	rfork n
> > 	mount -b /srv/plumbspace /n
>
> I don't understand it completly.

here's some explanation:
	mntgen
		- creates mountpoints on demand in /n
	srvfs plumbspace /n
		- runs exportfs exporting /n on /srv/plumbspace
	plumber
		- runs the plumber; this runs in the same namespace as the exportfs
			command, so if a command run by the plumber changes its namespace,
			the namespace exported by exportfs will change too.
			(the "Local" rule allows this to happen on command).
	rfork n
		- fork the namespace
	mount -b /srv/plumbspace /n
		- take the namespace exported by exportfs and mount it on /n.
			this makes exportfs's namespace visible, but at one
			level of indirection - any changes to /n made by
			the plumber will now be visible to all. /srv/plumbspace could
			be deleted at this point.

> After that, I try
>
> % 9fs unixbox
> % ls /n/unixbox
>
> and get nothing. My profile looks like this

this is almost certainly because of a problem with exportfs (it
can't keep references to directories that have been walked to but
not opened).  the problem isn't easy to fix without a kernel interface
change, but mntgen has a recent workaround that fixes the problem.

copy mntgen from sources, and i think your problem should go
away.

  cheers,
    rog.



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

* Re: [9fans] tip o' the day
  2005-02-08  8:05 [9fans] tip o' the day Russ Cox
                   ` (9 preceding siblings ...)
  2005-02-10  7:21 ` Vincent van Gelderen
@ 2005-02-15 15:33 ` andrey mirtchovski
  2005-02-15 16:48   ` Russ Cox
  10 siblings, 1 reply; 32+ messages in thread
From: andrey mirtchovski @ 2005-02-15 15:33 UTC (permalink / raw)
  To: 9fans

accessing the dump of another file system:

% 9fs sources
% 9fs sourcesdump
% history -d sourcesdump /n/sources/plan9/sys/src/cmd/ls.c
Jul  1 20:32:24 MDT 2004 /n/sources/plan9/sys/src/cmd/ls.c 5400 [jmk]
Jul  1 20:32:24 MDT 2004 /n/sourcesdump/2005/0215/plan9/sys/src/cmd/ls.c 5400 [jmk]
Dec 30 07:07:14 MST 2003 /n/sourcesdump/2004/0701/plan9/sys/src/cmd/ls.c 5388 [presotto]
Jun 15 11:46:59 MDT 2003 /n/sourcesdump/2003/1230/plan9/sys/src/cmd/ls.c 5284 [rsc]
Mar  2 16:59:32 MST 2003 /n/sourcesdump/2003/0615/plan9/sys/src/cmd/ls.c 5378 [rsc]
Feb 17 11:10:18 MST 2003 /n/sourcesdump/2003/0302/plan9/sys/src/cmd/ls.c 5440 [rsc]
Nov 11 10:09:11 MST 2002 /n/sourcesdump/2003/0217/plan9/sys/src/cmd/ls.c 5609 [rsc]
%

sourcesdump is hardcoded in the 9fs script, but is essentially a mount of
main/archive :)

andrey



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

* Re: [9fans] tip o' the day
  2005-02-15 15:33 ` andrey mirtchovski
@ 2005-02-15 16:48   ` Russ Cox
  0 siblings, 0 replies; 32+ messages in thread
From: Russ Cox @ 2005-02-15 16:48 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> accessing the dump of another file system:
>
> % 9fs sources
> % 9fs sourcesdump
> % history -d sourcesdump /n/sources/plan9/sys/src/cmd/ls.c

even easier now:

9fs sources
history /n/sources/plan9/sys/src/cmd/ls.c


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

* Re: [9fans] tip o' the day
  2005-02-15 15:29       ` rog
@ 2005-02-15 16:57         ` Matthias Teege
  2005-02-15 17:21           ` rog
  0 siblings, 1 reply; 32+ messages in thread
From: Matthias Teege @ 2005-02-15 16:57 UTC (permalink / raw)
  To: 9fans

> copy mntgen from sources, and i think your problem should go
> away.

Yes.  I copy mntgen from source and I can see my files ;-) But if I
run "local 9fs unixbox" first and then "local bind -c
/n/unixbox/foo/bar /n/bar" works.

Thanks alot
Matthias




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

* Re: [9fans] tip o' the day
  2005-02-15 16:57         ` Matthias Teege
@ 2005-02-15 17:21           ` rog
  2005-02-15 17:26             ` Ronald G. Minnich
  0 siblings, 1 reply; 32+ messages in thread
From: rog @ 2005-02-15 17:21 UTC (permalink / raw)
  To: 9fans

> Yes.  I copy mntgen from source and I can see my files ;-) But if I
> run "local 9fs unixbox" first and then "local bind -c
> /n/unixbox/foo/bar /n/bar" works.

yes, that'll work because the namespace is being changed locally
to mntgen.

your previous example was failing to work because the mount was in
your current namespace - through the exportfs "window".  the mount
worked ok, but exportfs didn't keep the reference to the mount-point
around, so mntgen removed the new directory.

the next time the mount point was created by mntgen, it was given a
new qid, and since the kernel uses qids to index its mount table, it
wasn't finding your mount point.

the change i made to mntgen was always to generate the same qid for a
given name; hence although mntgen does delete the name, at least
anything mounted on it will still be visible when it's created again.

the real fix (i think) is to allow fds to refer to non-open files in
the plan 9 syscall interface (hence allowing exportfs to retain
a reference to walked-to directories without opening them),
but that's a significant change, hence unlikely to happen.

i'm sure you didn't want to know that!

  cheers,
    rog.



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

* Re: [9fans] tip o' the day
  2005-02-15 17:21           ` rog
@ 2005-02-15 17:26             ` Ronald G. Minnich
  2005-02-15 17:34               ` rog
  0 siblings, 1 reply; 32+ messages in thread
From: Ronald G. Minnich @ 2005-02-15 17:26 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs



On Tue, 15 Feb 2005 rog@vitanuova.com wrote:

> the real fix (i think) is to allow fds to refer to non-open files in the
> plan 9 syscall interface (hence allowing exportfs to retain a reference
> to walked-to directories without opening them), but that's a significant
> change, hence unlikely to happen.

well, overall, it would be actually kind of neat if 9p was reflected right
out to userspace for some of the stuff I do. But boy, that is a change
from open/read/write/close, that's for sure.

ron


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

* Re: [9fans] tip o' the day
  2005-02-15 17:26             ` Ronald G. Minnich
@ 2005-02-15 17:34               ` rog
  0 siblings, 0 replies; 32+ messages in thread
From: rog @ 2005-02-15 17:34 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

actually, technically the changes could be fairly small (and
backwardly compatible).  the problems are those of naming, overall
desirability, and backwards compatibility of those programs that use
the new syscalls.

unless there are ramifications i'm not aware of, which is quite
likely.

[-- Attachment #2: Type: message/rfc822, Size: 3123 bytes --]

From: "Ronald G. Minnich" <rminnich@lanl.gov>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] tip o' the day
Date: Tue, 15 Feb 2005 10:26:03 -0700 (MST)
Message-ID: <Pine.LNX.4.58.0502151025180.13209@enigma.lanl.gov>



On Tue, 15 Feb 2005 rog@vitanuova.com wrote:

> the real fix (i think) is to allow fds to refer to non-open files in the
> plan 9 syscall interface (hence allowing exportfs to retain a reference
> to walked-to directories without opening them), but that's a significant
> change, hence unlikely to happen.

well, overall, it would be actually kind of neat if 9p was reflected right
out to userspace for some of the stuff I do. But boy, that is a change
from open/read/write/close, that's for sure.

ron

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

* Re: [9fans] tip o' the day
  2005-02-08 19:13 ` Micah Stetson
  2005-02-08 19:37   ` rog
@ 2005-02-16 19:17   ` McLone
  1 sibling, 0 replies; 32+ messages in thread
From: McLone @ 2005-02-16 19:17 UTC (permalink / raw)
  To: micah, Fans of the OS Plan 9 from Bell Labs

On Tue, 8 Feb 2005 11:13:59 -0800, Micah Stetson
<micah.stetson@gmail.com> wrote:
> Use files named guide for per-project scratch space in acme.
Good one.

--
wbr,                        |\      _,,,---,,_           dog bless ya!
`                       Zzz /,`.-'`'    -.  ;-;;,_
McLone at GMail dot com    |,4-  ) )-,_. ,\ (  `'-'
  net- and *BSD admin     '---''(_/--'  `-'\_)   ...sorry for emgrish


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

end of thread, other threads:[~2005-02-16 19:17 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-08  8:05 [9fans] tip o' the day Russ Cox
2005-02-08  8:07 ` [9fans] " Russ Cox
2005-02-08  8:16 ` [9fans] " Tim Newsham
2005-02-08  9:41 ` Fco. J. Ballesteros
2005-02-08  9:58   ` Steve Simon
2005-02-08 12:08   ` Robert Raschke
2005-02-08  9:51 ` Steve Simon
2005-02-08 16:31   ` Ronald G. Minnich
2005-02-08 10:01 ` Catalin(ux aka Dino) BOIE
2005-02-08 11:01   ` Charles Forsyth
2005-02-08 11:04     ` Catalin(ux aka Dino) BOIE
2005-02-08 15:46 ` andrey mirtchovski
2005-02-08 16:29 ` Ronald G. Minnich
2005-02-08 17:31 ` Sam
2005-02-08 18:22   ` Heiko Dudzus
2005-02-08 19:13 ` Micah Stetson
2005-02-08 19:37   ` rog
2005-02-08 19:54     ` andrey mirtchovski
2005-02-09 16:29       ` Ronald G. Minnich
2005-02-15 14:11     ` Matthias Teege
2005-02-15 15:29       ` rog
2005-02-15 16:57         ` Matthias Teege
2005-02-15 17:21           ` rog
2005-02-15 17:26             ` Ronald G. Minnich
2005-02-15 17:34               ` rog
2005-02-16 19:17   ` McLone
2005-02-10  7:21 ` Vincent van Gelderen
2005-02-10  7:40   ` Tim Newsham
2005-02-10 14:59     ` Russ Cox
2005-02-10 19:16       ` Tim Newsham
2005-02-15 15:33 ` andrey mirtchovski
2005-02-15 16:48   ` Russ Cox

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).