summaryrefslogtreecommitdiffstats
path: root/man/man8
diff options
context:
space:
mode:
authorChris Williamson <[email protected]>2018-02-08 09:17:52 -0700
committerBrian Behlendorf <[email protected]>2018-02-08 15:28:52 -0800
commit475eca4908731a87fff1be500ba4d7b011d392e4 (patch)
tree4dcc6c4bb7e897e94486c3c7e5aa6f95e413c789 /man/man8
parentd99a015343425a1c856c900aa8223016400ac2dc (diff)
OpenZFS 8605 - zfs channel programs fix zfs.exists
Authored by: Chris Williamson <[email protected]> Reviewed by: Paul Dagnelie <[email protected]> Reviewed by: Dan Kimmel <[email protected]> Reviewed by: Matt Ahrens <[email protected]> Approved by: Robert Mustacchi <[email protected]> Ported-by: Don Brady <[email protected]> zfs.exists() in channel programs doesn't return any result, and should have a man page entry. This patch corrects zfs.exists so that it returns a value indicating if the dataset exists or not. It also adds documentation about it in the man page. OpenZFS-issue: https://www.illumos.org/issues/8605 OpenZFS-commit: https://github.com/openzfs/openzfs/commit/1e85e111
Diffstat (limited to 'man/man8')
-rw-r--r--man/man8/zfs-program.812
1 files changed, 12 insertions, 0 deletions
diff --git a/man/man8/zfs-program.8 b/man/man8/zfs-program.8
index d84990ca1..2e4e9587d 100644
--- a/man/man8/zfs-program.8
+++ b/man/man8/zfs-program.8
@@ -289,6 +289,18 @@ msg (string)
.Bd -ragged -compact -offset "xxxx"
Debug message to be printed.
.Ed
+.It Em zfs.exists(dataset)
+Returns true if the given dataset exists, or false if it doesn't.
+A fatal error will be thrown if the dataset is not in the target pool.
+That is, in a channel program running on rpool,
+zfs.exists("rpool/nonexistent_fs") returns false, but
+zfs.exists("somepool/fs_that_may_exist") will error.
+.Pp
+dataset (string)
+.Bd -ragged -compact -offset "xxxx"
+Dataset to check for existence.
+Must be in the target pool.
+.Ed
.It Em zfs.get_prop(dataset, property)
Returns two values.
First, a string, number or table containing the property value for the given