X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=python%2Fguestfs.py;h=a82c8cba48878fea56dbd003b19f44b7d2d570e2;hb=6b668620681ada82857e09922a0feb004ee65882;hp=77c29895bb748e227e7854d5f25ce9f0181ec293;hpb=ca49c50e06834bbc68e21630a5552c57494f2b53;p=libguestfs.git diff --git a/python/guestfs.py b/python/guestfs.py index 77c2989..a82c8cb 100644 --- a/python/guestfs.py +++ b/python/guestfs.py @@ -1433,6 +1433,54 @@ class GuestFS: def resize2fs (self, device): u"""This resizes an ext2 or ext3 filesystem to match the size of the underlying device. + + *Note:* It is sometimes required that you run + "g.e2fsck_f" on the "device" before calling this + command. For unknown reasons "resize2fs" sometimes gives + an error about this and sometimes not. In any case, it + is always safe to call "g.e2fsck_f" before calling this + function. """ return libguestfsmod.resize2fs (self._o, device) + def find (self, directory): + u"""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: + + /tmp/a + /tmp/b + /tmp/c/d + + then the returned list from "g.find" "/tmp" would be 4 + elements: + + a + b + c + c/d + + If "directory" is not a directory, then this command + returns an error. + + The returned list is sorted. + + This function returns a list of strings. + """ + return libguestfsmod.find (self._o, directory) + + def e2fsck_f (self, device): + u"""This runs "e2fsck -p -f device", ie. runs the ext2/ext3 + filesystem checker on "device", noninteractively ("-p"), + even if the filesystem appears to be clean ("-f"). + + This command is only needed because of "g.resize2fs" + (q.v.). Normally you should use "g.fsck". + """ + return libguestfsmod.e2fsck_f (self._o, device) +