Query: sys::guestfs
OS: centos
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
Sys::Guestfs(3) User Contributed Perl Documentation Sys::Guestfs(3)NAMESys::Guestfs - Perl bindings for libguestfsSYNOPSISuse Sys::Guestfs; my $g = Sys::Guestfs->new (); $g->add_drive_opts ('guest.img', format => 'raw'); $g->launch (); $g->mount ('/dev/sda1', '/'); $g->touch ('/hello'); $g->shutdown (); $g->close ();DESCRIPTIONThe "Sys::Guestfs" module provides a Perl XS binding to the libguestfs API for examining and modifying virtual machine disk images. Amongst the things this is good for: making batch configuration changes to guests, getting disk used/free statistics (see also: virt-df), migrating between virtualization systems (see also: virt-p2v), performing partial backups, performing partial guest clones, cloning guests and changing registry/UUID/hostname info, and much else besides. Libguestfs uses Linux kernel and qemu code, and can access any type of guest filesystem that Linux and qemu can, including but not limited to: ext2/3/4, btrfs, FAT and NTFS, LVM, many different disk partition schemes, qcow, qcow2, vmdk. Libguestfs provides ways to enumerate guest storage (eg. partitions, LVs, what filesystem is in each LV, etc.). It can also run commands in the context of the guest. Also you can access filesystems over FUSE.ERRORSAll errors turn into calls to "croak" (see Carp(3)). The error string from libguestfs is directly available from $@. Use the "last_errno" method if you want to get the errno.METHODS$g = Sys::Guestfs->new ([environment => 0,] [close_on_exit => 0]); Create a new guestfs handle. If the optional argument "environment" is false, then the "GUESTFS_CREATE_NO_ENVIRONMENT" flag is set. If the optional argument "close_on_exit" is false, then the "GUESTFS_CREATE_NO_CLOSE_ON_EXIT" flag is set. $g->close (); Explicitly close the guestfs handle. Note: You should not usually call this function. The handle will be closed implicitly when its reference count goes to zero (eg. when it goes out of scope or the program ends). This call is only required in some exceptional cases, such as where the program may contain cached references to the handle 'somewhere' and you really have to have the close happen right away. After calling "close" the program must not call any method (including "close") on the handle (but the implicit call to "DESTROY" that happens when the final reference is cleaned up is OK). $Sys::Guestfs::EVENT_CLOSE See "GUESTFS_EVENT_CLOSE" in guestfs(3). $Sys::Guestfs::EVENT_SUBPROCESS_QUIT See "GUESTFS_EVENT_SUBPROCESS_QUIT" in guestfs(3). $Sys::Guestfs::EVENT_LAUNCH_DONE See "GUESTFS_EVENT_LAUNCH_DONE" in guestfs(3). $Sys::Guestfs::EVENT_PROGRESS See "GUESTFS_EVENT_PROGRESS" in guestfs(3). $Sys::Guestfs::EVENT_APPLIANCE See "GUESTFS_EVENT_APPLIANCE" in guestfs(3). $Sys::Guestfs::EVENT_LIBRARY See "GUESTFS_EVENT_LIBRARY" in guestfs(3). $Sys::Guestfs::EVENT_TRACE See "GUESTFS_EVENT_TRACE" in guestfs(3). $Sys::Guestfs::EVENT_ENTER See "GUESTFS_EVENT_ENTER" in guestfs(3). $Sys::Guestfs::EVENT_LIBVIRT_AUTH See "GUESTFS_EVENT_LIBVIRT_AUTH" in guestfs(3). $Sys::Guestfs::EVENT_ALL See "GUESTFS_EVENT_ALL" in guestfs(3). $event_handle = $g->set_event_callback (&cb, $event_bitmask); Register "cb" as a callback function for all of the events in $event_bitmask (one or more "$Sys::Guestfs::EVENT_*" flags logically or'd together). This function returns an event handle which can be used to delete the callback using "delete_event_callback". The callback function receives 4 parameters: &cb ($event, $event_handle, $buf, $array) $event The event which happened (equal to one of "$Sys::Guestfs::EVENT_*"). $event_handle The event handle. $buf For some event types, this is a message buffer (ie. a string). $array For some event types (notably progress events), this is an array of integers. You should carefully read the documentation for "guestfs_set_event_callback" in guestfs(3) before using this function. $g->delete_event_callback ($event_handle); This removes the callback which was previously registered using "set_event_callback". $str = Sys::Guestfs::event_to_string ($events); $events is either a single event or a bitmask of events. This returns a printable string, useful for debugging. Note that this is a class function, not a method. $errnum = $g->last_errno (); This returns the last error number (errno) that happened on the handle $g. If successful, an errno integer not equal to zero is returned. If no error number is available, this returns 0. See "guestfs_last_errno" in guestfs(3) for more details of why this can happen. You can use the standard Perl module Errno(3) to compare the numeric error returned from this call with symbolic errnos: $g->mkdir ("/foo"); if ($g->last_errno() == Errno::EEXIST()) { # mkdir failed because the directory exists already. } $g->acl_delete_def_file ($dir); This function deletes the default POSIX Access Control List (ACL) attached to directory "dir". $acl = $g->acl_get_file ($path, $acltype); This function returns the POSIX Access Control List (ACL) attached to "path". The ACL is returned in "long text form" (see acl(5)). The "acltype" parameter may be: "access" Return the ordinary (access) ACL for any file, directory or other filesystem object. "default" Return the default ACL. Normally this only makes sense if "path" is a directory. $g->acl_set_file ($path, $acltype, $acl); This function sets the POSIX Access Control List (ACL) attached to "path". The "acltype" parameter may be: "access" Set the ordinary (access) ACL for any file, directory or other filesystem object. "default" Set the default ACL. Normally this only makes sense if "path" is a directory. The "acl" parameter is the new ACL in either "long text form" or "short text form" (see acl(5)). The new ACL completely replaces any previous ACL on the file. The ACL must contain the full Unix permissions (eg. "u::rwx,g::rx,o::rx"). If you are specifying individual users or groups, then the mask field is also required (eg. "m::rwx"), followed by the "u:ID:..." and/or "g:ID:..." field(s). A full ACL string might therefore look like this: u::rwx,g::rwx,o::rwx,m::rwx,u:500:rwx,g:500:rwx Unix permissions / mask/ ACL / You should use numeric UIDs and GIDs. To map usernames and groupnames to the correct numeric ID in the context of the guest, use the Augeas functions (see "$g->aug_init"). $g->add_cdrom ($filename); This function adds a virtual CD-ROM disk image to the guest. Do not use this function! ISO files are just ordinary read-only disk images. Use "$g->add_drive_ro" instead. This function is deprecated. In new code, use the "add_drive" call instead. Deprecated functions will not be removed from the API, but the fact that they are deprecated indicates that there are problems with correct use of these functions. $nrdisks = $g->add_domain ($dom [, libvirturi => $libvirturi] [, readonly => $readonly] [, iface => $iface] [, live => $live] [, allowuuid => $allowuuid] [, readonlydisk => $readonlydisk]); This function adds the disk(s) attached to the named libvirt domain "dom". It works by connecting to libvirt, requesting the domain and domain XML from libvirt, parsing it for disks, and calling "$g->add_drive_opts" on each one. The number of disks added is returned. This operation is atomic: if an error is returned, then no disks are added. This function does some minimal checks to make sure the libvirt domain is not running (unless "readonly" is true). In a future version we will try to acquire the libvirt lock on each disk. Disks must be accessible locally. This often means that adding disks from a remote libvirt connection (see <http://libvirt.org/remote.html>) will fail unless those disks are accessible via the same device path locally too. The optional "libvirturi" parameter sets the libvirt URI (see <http://libvirt.org/uri.html>). If this is not set then we connect to the default libvirt URI (or one set through an environment variable, see the libvirt documentation for full details). The optional "live" flag controls whether this call will try to connect to a running virtual machine "guestfsd" process if it sees a suitable <channel> element in the libvirt XML definition. The default (if the flag is omitted) is never to try. See "ATTACHING TO RUNNING DAEMONS" in guestfs(3) for more information. If the "allowuuid" flag is true (default is false) then a UUID may be passed instead of the domain name. The "dom" string is treated as a UUID first and looked up, and if that lookup fails then we treat "dom" as a name as usual. The optional "readonlydisk" parameter controls what we do for disks which are marked <readonly/> in the libvirt XML. Possible values are: readonlydisk = "error" If "readonly" is false: The whole call is aborted with an error if any disk with the <readonly/> flag is found. If "readonly" is true: Disks with the <readonly/> flag are added read-only. readonlydisk = "read" If "readonly" is false: Disks with the <readonly/> flag are added read-only. Other disks are added read/write. If "readonly" is true: Disks with the <readonly/> flag are added read-only. readonlydisk = "write" (default) If "readonly" is false: Disks with the <readonly/> flag are added read/write. If "readonly" is true: Disks with the <readonly/> flag are added read-only. readonlydisk = "ignore" If "readonly" is true or false: Disks with the <readonly/> flag are skipped. The other optional parameters are passed directly through to "$g->add_drive_opts". $g->add_drive ($filename [, readonly => $readonly] [, format => $format] [, iface => $iface] [, name => $name] [, label => $label] [, protocol => $protocol] [, server => $server] [, username => $username] [, secret => $secret] [, cachemode => $cachemode]); This function adds a disk image called "filename" to the handle. "filename" may be a regular host file or a host device. When this function is called before "$g->launch" (the usual case) then the first time you call this function, the disk appears in the API as "/dev/sda", the second time as "/dev/sdb", and so on. In libguestfs X 1.20 you can also call this function after launch (with some restrictions). This is called "hotplugging". When hotplugging, you must specify a "label" so that the new disk gets a predictable name. For more information see "HOTPLUGGING" in guestfs(3). You don't necessarily need to be root when using libguestfs. However you obviously do need sufficient permissions to access the filename for whatever operations you want to perform (ie. read access if you just want to read the image or write access if you want to modify the image). This call checks that "filename" exists. "filename" may be the special string "/dev/null". See "NULL DISKS" in guestfs(3). The optional arguments are: "readonly" If true then the image is treated as read-only. Writes are still allowed, but they are stored in a temporary snapshot overlay which is discarded at the end. The disk that you add is not modified. "format" This forces the image format. If you omit this (or use "$g->add_drive" or "$g->add_drive_ro") then the format is automatically detected. Possible formats include "raw" and "qcow2". Automatic detection of the format opens you up to a potential security hole when dealing with untrusted raw-format images. See CVE-2010-3851 and RHBZ#642934. Specifying the format closes this security hole. "iface" This rarely-used option lets you emulate the behaviour of the deprecated "$g->add_drive_with_if" call (q.v.) "name" The name the drive had in the original guest, e.g. "/dev/sdb". This is used as a hint to the guest inspection process if it is available. "label" Give the disk a label. The label should be a unique, short string using only ASCII characters "[a-zA-Z]". As well as its usual name in the API (such as "/dev/sda"), the drive will also be named "/dev/disk/guestfs/label". See "DISK LABELS" in guestfs(3). "protocol" The optional protocol argument can be used to select an alternate source protocol. See also: "REMOTE STORAGE" in guestfs(3). "protocol = "file"" "filename" is interpreted as a local file or device. This is the default if the optional protocol parameter is omitted. "protocol = "nbd"" Connect to the Network Block Device server. The "server" parameter must also be supplied - see below. See also: "NETWORK BLOCK DEVICE" in guestfs(3). "server" For protocols which require access to a remote server, this is a list of server(s). Protocol Number of servers required -------- -------------------------- file List must be empty or param not used at all nbd Exactly one Each list element is a string specifying a server. The string must be in one of the following formats: hostname hostname:port tcp:hostname tcp:hostname:port unix:/path/to/socket If the port number is omitted, then the standard port number for the protocol is used (see "/etc/services"). "cachemode" Choose whether or not libguestfs will obey sync operations (safe but slow) or not (unsafe but fast). The possible values for this string are: "cachemode = "writeback"" This is the default. Write operations in the API do not return until a write(2) call has completed in the host [but note this does not imply that anything gets written to disk]. Sync operations in the API, including implicit syncs caused by filesystem journalling, will not return until an fdatasync(2) call has completed in the host, indicating that data has been committed to disk. "cachemode = "unsafe"" In this mode, there are no guarantees. Libguestfs may cache anything and ignore sync requests. This is suitable only for scratch or temporary disks. $g->add_drive_opts ($filename [, readonly => $readonly] [, format => $format] [, iface => $iface] [, name => $name] [, label => $label] [, protocol => $protocol] [, server => $server] [, username => $username] [, secret => $secret] [, cachemode => $cachemode]); This is an alias of "add_drive". $g->add_drive_ro ($filename); This function is the equivalent of calling "$g->add_drive_opts" with the optional parameter "GUESTFS_ADD_DRIVE_OPTS_READONLY" set to 1, so the disk is added read-only, with the format being detected automatically. $g->add_drive_ro_with_if ($filename, $iface); This is the same as "$g->add_drive_ro" but it allows you to specify the QEMU interface emulation to use at run time. This function is deprecated. In new code, use the "add_drive" call instead. Deprecated functions will not be removed from the API, but the fact that they are deprecated indicates that there are problems with correct use of these functions. $g->add_drive_scratch ($size [, name => $name] [, label => $label]); This command adds a temporary scratch drive to the handle. The "size" parameter is the virtual size (in bytes). The scratch drive is blank initially (all reads return zeroes until you start writing to it). The drive is deleted when the handle is closed. The optional arguments "name" and "label" are passed through to "$g->add_drive". $g->add_drive_with_if ($filename, $iface); This is the same as "$g->add_drive" but it allows you to specify the QEMU interface emulation to use at run time. This function is deprecated. In new code, use the "add_drive" call instead. Deprecated functions will not be removed from the API, but the fact that they are deprecated indicates that there are problems with correct use of these functions. $g->aug_clear ($augpath); Set the value associated with "path" to "NULL". This is the same as the augtool(1) "clear" command. $g->aug_close (); Close the current Augeas handle and free up any resources used by it. After calling this, you have to call "$g->aug_init" again before you can use any other Augeas functions. %nrnodescreated = $g->aug_defnode ($name, $expr, $val); Defines a variable "name" whose value is the result of evaluating "expr". If "expr" evaluates to an empty nodeset, a node is created, equivalent to calling "$g->aug_set" "expr", "value". "name" will be the nodeset containing that single node. On success this returns a pair containing the number of nodes in the nodeset, and a boolean flag if a node was created. $nrnodes = $g->aug_defvar ($name, $expr); Defines an Augeas variable "name" whose value is the result of evaluating "expr". If "expr" is NULL, then "name" is undefined. On success this returns the number of nodes in "expr", or 0 if "expr" evaluates to something which is not a nodeset. $val = $g->aug_get ($augpath); Look up the value associated with "path". If "path" matches exactly one node, the "value" is returned. $g->aug_init ($root, $flags); Create a new Augeas handle for editing configuration files. If there was any previous Augeas handle associated with this guestfs session, then it is closed. You must call this before using any other "$g->aug_*" commands. "root" is the filesystem root. "root" must not be NULL, use "/" instead. The flags are the same as the flags defined in <augeas.h>, the logical or of the following integers: "AUG_SAVE_BACKUP" = 1 Keep the original file with a ".augsave" extension. "AUG_SAVE_NEWFILE" = 2 Save changes into a file with extension ".augnew", and do not overwrite original. Overrides "AUG_SAVE_BACKUP". "AUG_TYPE_CHECK" = 4 Typecheck lenses. This option is only useful when debugging Augeas lenses. Use of this option may require additional memory for the libguestfs appliance. You may need to set the "LIBGUESTFS_MEMSIZE" environment variable or call "$g->set_memsize". "AUG_NO_STDINC" = 8 Do not use standard load path for modules. "AUG_SAVE_NOOP" = 16 Make save a no-op, just record what would have been changed. "AUG_NO_LOAD" = 32 Do not load the tree in "$g->aug_init". To close the handle, you can call "$g->aug_close". To find out more about Augeas, see <http://augeas.net/>. $g->aug_insert ($augpath, $label, $before); Create a new sibling "label" for "path", inserting it into the tree before or after "path" (depending on the boolean flag "before"). "path" must match exactly one existing node in the tree, and "label" must be a label, ie. not contain "/", "*" or end with a bracketed index "[N]". $g->aug_load (); Load files into the tree. See "aug_load" in the Augeas documentation for the full gory details. @matches = $g->aug_ls ($augpath); This is just a shortcut for listing "$g->aug_match" "path/*" and sorting the resulting nodes into alphabetical order. @matches = $g->aug_match ($augpath); Returns a list of paths which match the path expression "path". The returned paths are sufficiently qualified so that they match exactly one node in the current tree. $g->aug_mv ($src, $dest); Move the node "src" to "dest". "src" must match exactly one node. "dest" is overwritten if it exists. $nrnodes = $g->aug_rm ($augpath); Remove "path" and all of its children. On success this returns the number of entries which were removed. $g->aug_save (); This writes all pending changes to disk. The flags which were passed to "$g->aug_init" affect exactly how files are saved. $g->aug_set ($augpath, $val); Set the value associated with "path" to "val". In the Augeas API, it is possible to clear a node by setting the value to NULL. Due to an oversight in the libguestfs API you cannot do that with this call. Instead you must use the "$g->aug_clear" call. $g->available (@groups); This command is used to check the availability of some groups of functionality in the appliance, which not all builds of the libguestfs appliance will be able to provide. The libguestfs groups, and the functions that those groups correspond to, are listed in "AVAILABILITY" in guestfs(3). You can also fetch this list at runtime by calling "$g->available_all_groups". The argument "groups" is a list of group names, eg: "["inotify", "augeas"]" would check for the availability of the Linux inotify functions and Augeas (configuration file editing) functions. The command returns no error if all requested groups are available. It fails with an error if one or more of the requested groups is unavailable in the appliance. If an unknown group name is included in the list of groups then an error is always returned. Notes: o "$g->feature_available" is the same as this call, but with a slightly simpler to use API: that call returns a boolean true/false instead of throwing an error. o You must call "$g->launch" before calling this function. The reason is because we don't know what groups are supported by the appliance/daemon until it is running and can be queried. o If a group of functions is available, this does not necessarily mean that they will work. You still have to check for errors when calling individual API functions even if they are available. o It is usually the job of distro packagers to build complete functionality into the libguestfs appliance. Upstream libguestfs, if built from source with all requirements satisfied, will support everything. o This call was added in version 1.0.80. In previous versions of libguestfs all you could do would be to speculatively execute a command to find out if the daemon implemented it. See also "$g->version". See also "$g->filesystem_available". @groups = $g->available_all_groups (); This command returns a list of all optional groups that this daemon knows about. Note this returns both supported and unsupported groups. To find out which ones the daemon can actually support you have to call "$g->available" / "$g->feature_available" on each member of the returned list. See also "$g->available", "$g->feature_available" and "AVAILABILITY" in guestfs(3). $g->base64_in ($base64file, $filename); This command uploads base64-encoded data from "base64file" to "filename". $g->base64_out ($filename, $base64file); This command downloads the contents of "filename", writing it out to local file "base64file" encoded as base64. %info = $g->blkid ($device); This command returns block device attributes for "device". The following fields are usually present in the returned hash. Other fields may also be present. "UUID" The uuid of this device. "LABEL" The label of this device. "VERSION" The version of blkid command. "TYPE" The filesystem type or RAID of this device. "USAGE" The usage of this device, for example "filesystem" or "raid". $g->blockdev_flushbufs ($device); This tells the kernel to flush internal buffers associated with "device". This uses the blockdev(8) command. $blocksize = $g->blockdev_getbsz ($device); This returns the block size of a device. Note: this is different from both size in blocks and filesystem block size. Also this setting is not really used by anything. You should probably not use it for anything. Filesystems have their own idea about what block size to choose. This uses the blockdev(8) command. $ro = $g->blockdev_getro ($device); Returns a boolean indicating if the block device is read-only (true if read-only, false if not). This uses the blockdev(8) command. $sizeinbytes = $g->blockdev_getsize64 ($device); This returns the size of the device in bytes. See also "$g->blockdev_getsz". This uses the blockdev(8) command. $sectorsize = $g->blockdev_getss ($device); This returns the size of sectors on a block device. Usually 512, but can be larger for modern devices. (Note, this is not the size in sectors, use "$g->blockdev_getsz" for that). This uses the blockdev(8) command. $sizeinsectors = $g->blockdev_getsz ($device); This returns the size of the device in units of 512-byte sectors (even if the sectorsize isn't 512 bytes ... weird). See also "$g->blockdev_getss" for the real sector size of the device, and "$g->blockdev_getsize64" for the more useful size in bytes. This uses the blockdev(8) command. $g->blockdev_rereadpt ($device); Reread the partition table on "device". This uses the blockdev(8) command. $g->blockdev_setbsz ($device, $blocksize); This call does nothing and has never done anything because of a bug in blockdev. Do not use it. If you need to set the filesystem block size, use the "blocksize" option of "$g->mkfs". This function is deprecated. In new code, use the "mkfs" call instead. Deprecated functions will not be removed from the API, but the fact that they are deprecated indicates that there are problems with correct use of these functions. $g->blockdev_setro ($device); Sets the block device named "device" to read-only. This uses the blockdev(8) command. $g->blockdev_setrw ($device); Sets the block device named "device" to read-write. This uses the blockdev(8) command. $g->btrfs_device_add (@devices, $fs); Add the list of device(s) in "devices" to the btrfs filesystem mounted at "fs". If "devices" is an empty list, this does nothing. $g->btrfs_device_delete (@devices, $fs); Remove the "devices" from the btrfs filesystem mounted at "fs". If "devices" is an empty list, this does nothing. $g->btrfs_filesystem_balance ($fs); Balance the chunks in the btrfs filesystem mounted at "fs" across the underlying devices. $g->btrfs_filesystem_resize ($mountpoint [, size => $size]); This command resizes a btrfs filesystem. Note that unlike other resize calls, the filesystem has to be mounted and the parameter is the mountpoint not the device (this is a requirement of btrfs itself). The optional parameters are: "size" The new size (in bytes) of the filesystem. If omitted, the filesystem is resized to the maximum size. See also btrfs(8). $g->btrfs_filesystem_sync ($fs); Force sync on the btrfs filesystem mounted at "fs". $g->btrfs_fsck ($device [, superblock => $superblock] [, repair => $repair]); Used to check a btrfs filesystem, "device" is the device file where the filesystem is stored. $g->btrfs_set_seeding ($device, $seeding); Enable or disable the seeding feature of a device that contains a btrfs filesystem. $g->btrfs_subvolume_create ($dest); Create a btrfs subvolume. The "dest" argument is the destination directory and the name of the snapshot, in the form "/path/to/dest/name". $g->btrfs_subvolume_delete ($subvolume); Delete the named btrfs subvolume. @subvolumes = $g->btrfs_subvolume_list ($fs); List the btrfs snapshots and subvolumes of the btrfs filesystem which is mounted at "fs". $g->btrfs_subvolume_set_default ($id, $fs); Set the subvolume of the btrfs filesystem "fs" which will be mounted by default. See "$g->btrfs_subvolume_list" to get a list of subvolumes. $g->btrfs_subvolume_snapshot ($source, $dest); Create a writable snapshot of the btrfs subvolume "source". The "dest" argument is the destination directory and the name of the snapshot, in the form "/path/to/dest/name". $canonical = $g->canonical_device_name ($device); This utility function is useful when displaying device names to the user. It takes a number of irregular device names and returns them in a consistent format: "/dev/hdX" "/dev/vdX" These are returned as "/dev/sdX". Note this works for device names and partition names. This is approximately the reverse of the algorithm described in "BLOCK DEVICE NAMING" in guestfs(3). "/dev/mapper/VG-LV" "/dev/dm-N" Converted to "/dev/VG/LV" form using "$g->lvm_canonical_lvm_name". Other strings are returned unmodified. $cap = $g->cap_get_file ($path); This function returns the Linux capabilities attached to "path". The capabilities set is returned in text form (see cap_to_text(3)). If no capabilities are attached to a file, an empty string is returned. $g->cap_set_file ($path, $cap); This function sets the Linux capabilities attached to "path". The capabilities set "cap" should be passed in text form (see cap_from_text(3)). $rpath = $g->case_sensitive_path ($path); This can be used to resolve case insensitive paths on a filesystem which is case sensitive. The use case is to resolve paths which you have read from Windows configuration files or the Windows Registry, to the true path. The command handles a peculiarity of the Linux ntfs-3g filesystem driver (and probably others), which is that although the underlying filesystem is case-insensitive, the driver exports the filesystem to Linux as case-sensitive. One consequence of this is that special directories such as "c:windows" may appear as "/WINDOWS" or "/windows" (or other things) depending on the precise details of how they were created. In Windows itself this would not be a problem. Bug or feature? You decide: <http://www.tuxera.com/community/ntfs-3g-faq/#posixfilenames1> This function resolves the true case of each element in the path and returns the case-sensitive path. Thus "$g->case_sensitive_path" ("/Windows/System32") might return "/WINDOWS/system32" (the exact return value would depend on details of how the directories were originally created under Windows). Note: This function does not handle drive names, backslashes etc. See also "$g->realpath". $content = $g->cat ($path); Return the contents of the file named "path". Because, in C, this function returns a "char *", there is no way to differentiate between a "