find


Description:

[ CCode ( array_length = false , array_null_terminated = true ) ]
[ Version ( since = "1.0.27" ) ]
public string[] find (string directory) throws Error

find all files and directories

This command lists out all files and directories, recursively, starting at directory. It is essentially equivalent to running the shell command "find directory -print" but some post-processing happens on the output, described below.

This returns a list of strings *without any prefix*. Thus if the directory structure was:

<![CDATA[/tmp/a]]>

<![CDATA[/tmp/b]]>

<![CDATA[/tmp/c/d]]>

then the returned list from find /tmp would be 4 elements:

<![CDATA[a]]>

<![CDATA[b]]>

<![CDATA[c]]>

<![CDATA[c/d]]>

If directory is not a directory, then this command returns an error.

The returned list is sorted.

Parameters:

this

A GuestfsSession object

Returns:

an array of returned strings, or NULL on error