Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] make _file_systems know zfs on solaris



On 2008-09-11 at 20:44 +0200, "xRaich[o]²x" wrote:
> --- ../4.3.6/functions/_file_systems    Sun Sep  7 09:35:43 2008
> +++ _file_systems    Thu Sep 11 20:30:27 2008
> @@ -15,7 +15,7 @@
>          fss+=( ${$(</etc/filesystems)#\*} )
>    ;;
>    osf*) fss=( advfs ufs nfs mfs cdfs ) ;;
> -  solaris*) fss=( ufs nfs hsfs s5fs pcfs cachefs tmpfs ) ;;
> +  solaris*) fss=( ufs nfs hsfs s5fs pcfs cachefs tmpfs zfs ) ;;
>    freebsd*|dragonfly*)
>      fss=( cd9660 devfs ext2fs fdesc kernfs linprocfs mfs msdos nfs
>            ntfs null nwfs portal procfs std udf ufs umap union )

I happen to know that FreeBSD 7 onwards also has zfs.

Using Wikipedia seems reasonable for finding out the current known
spread of a filesystem; NetBSD port started, MacOS port available, Linux
port in beta stage as of March 2008.

So this is probably worth adding to 4 of the explicit cases handled in
Completion/Unix/Type/_file_systems and at this stage, safest to also add
it to the default case, or start another book-keeping hassle by
expanding the number of OSes explicitly tracked.  I say this with a
practicality hat on, no advocacy -- I don't currently use ZFS (the
FreeBSD port doesn't yet support ACLs, which I use extensively).

In fact, since NFS is standards-specified and supported to some degree
or another on a wide variety of Unices, should 'nfs' be in the * case?
(Although FreeBSD has both 'nfs' and 'nfs4').

While the spelling used for the ISO 9660 FS varies between platforms,
the UDF format used on DVDs is widely supported and not likely to vary
much, so that should probably go in too.

So the *) branch should IMO set fss=( nfs udf ufs zfs )

Possibly also NTFS which is fairly widespread and consistently named.

FreeBSD supports more FSes than listed above.  Missing are:
  nfs4 reiserfs smbfs 
and both 'msdos' and 'portal' should be spelt with a trailing 'fs'.

With zsh/parameter loaded, ${commands[(R)*/mount_*]##*/mount_} gets all
the filesystems mounted with a mount_* command, and I believe that
there's a mount_<fstype> command for all filesystems except 'ufs', the
default FS.  ("mount -t foo" will work if there's a mount_foo).  (I used
to be sure here, but I haven't looked into how things have changed with
the new nmount(2) interface and if that affects things).

Off the top of my head, I don't know how widespread the mount_* command
system is, besides that it's not used by Linux.

-Phil



Messages sorted by: Reverse Date, Date, Thread, Author