I regularly create new zfs filesystems or snapshots and I find it 
annoying that I have to type the full dataset name in all of those cases.

I propose we allow zfs(1) to infer the part of the dataset name upto the 
current working directory.  For example:

Today:

$ zfs create cube/builds/darrenm/bugs/6724478

With this proposal:

$ pwd
/cube/builds/darrenm/bugs
$ zfs create 6724478

Both of these would result in a new dataset cube/builds/darrenm/6724478

This will need some careful though about how to deal with cases like this:

$ pwd
/cube/builds/
$ zfs create 6724478/test

What should that do ? should it create cube/builds/6724478 and 
cube/builds/6724478/test ?  Or should it fail ?  -p already provides
some capbilities in this area.

Maybe the easiest way out of the ambiquity is to add a flag to zfs 
create for the partial dataset name eg:

$ pwd
/cube/builds/darrenm/bugs
$ zfs create -c 6724478

Why "-c" ?  -c for "current directory"  "-p" partial is already taken to 
mean "create all non existing parents" and "-r" relative is already used 
consistently as "recurse" in other zfs(1) commands (as well as lots of 
other places).

Alternately:

$ pwd
/cube/builds/darrenm/bugs
$ zfs mkdir 6724478

Which would act like mkdir does (including allowing a -p and -m flag 
with the same meaning as mkdir(1)) but creates datasets instead of 
directories.

Thoughts ?  Is this useful for anyone else ?  My above examples are some 
of the shorter dataset names I use, ones in my home directory can be 
even deeper.

-- 
Darren J Moffat
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to