diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2009-06-24 18:25:09 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2009-06-24 18:25:09 +0100 |
commit | 0574eab8bc7d8e72db862ec36815835938a5fdf1 (patch) | |
tree | 6588315e33f95de9fbb150f862064471a975050e /perl | |
parent | 8228eec99045ae720d8ef35851aa8c278f6b4e5c (diff) | |
download | libguestfs-0574eab8bc7d8e72db862ec36815835938a5fdf1.tar.gz libguestfs-0574eab8bc7d8e72db862ec36815835938a5fdf1.tar.xz libguestfs-0574eab8bc7d8e72db862ec36815835938a5fdf1.zip |
Generated code for 'mkdtemp' command.
Diffstat (limited to 'perl')
-rw-r--r-- | perl/Guestfs.xs | 15 | ||||
-rw-r--r-- | perl/lib/Sys/Guestfs.pm | 18 |
2 files changed, 33 insertions, 0 deletions
diff --git a/perl/Guestfs.xs b/perl/Guestfs.xs index 4b059101..96b02f9b 100644 --- a/perl/Guestfs.xs +++ b/perl/Guestfs.xs @@ -2635,3 +2635,18 @@ PREINIT: if (r == -1) croak ("scrub_freespace: %s", guestfs_last_error (g)); +SV * +mkdtemp (g, template) + guestfs_h *g; + char *template; +PREINIT: + char *dir; + CODE: + dir = guestfs_mkdtemp (g, template); + if (dir == NULL) + croak ("mkdtemp: %s", guestfs_last_error (g)); + RETVAL = newSVpv (dir, 0); + free (dir); + OUTPUT: + RETVAL + diff --git a/perl/lib/Sys/Guestfs.pm b/perl/lib/Sys/Guestfs.pm index 9c5aa183..bd2a80c9 100644 --- a/perl/lib/Sys/Guestfs.pm +++ b/perl/lib/Sys/Guestfs.pm @@ -852,6 +852,24 @@ Create a directory named C<path>. Create a directory named C<path>, creating any parent directories as necessary. This is like the C<mkdir -p> shell command. +=item $dir = $h->mkdtemp ($template); + +This command creates a temporary directory. The +C<template> parameter should be a full pathname for the +temporary directory with the six characters being +"XXXXXX". + +For example: "/tmp/tmpXXXXXX" or "/Temp/tmpXXXXXX", +the second one being suitable for Windows. + +The name of the temporary directory that was created +is returned. + +The caller is responsible for deleting the temporary +directory and its contents after use. + +See also: L<mkdtemp(3)> + =item $h->mkfs ($fstype, $device); This creates a filesystem on C<device> (usually a partition |