Richard W.M. Jones
2015-Nov-18 14:22 UTC
Re: [Libguestfs] [virt-tools-list] Paths with whitespace in guestfish
[I don't check this list for libguestfs questions, hence the late reply. There's a libguestfs mailing list: https://www.redhat.com/mailman/listinfo/libguestfs ] On Mon, Oct 12, 2015 at 08:06:03PM -0500, Robert Nichols wrote:> Is guestfish able to handle paths that include whitespace? I've > tried just about everything I can think of: > > ><fs> ls /Users/Owner/My\ Documents > ls should have 1 parameter(s) > type 'help ls' for help on ls > ><fs> ls "/Users/Owner/My Documents" > libguestfs: error: ls0: opendir: /Users/Owner/My Documents: No such > file or directoryThis syntax (single or double quoting) is the correct one and works fine for me:><fs> ls "/Program Files/Windows NT/Accessories"mswrd6.wpc mswrd8.wpc wordpad.exe write.wpc I'm guessing it may be a case sensitivity problem. You could try prepending 'win:...' (a guestfish-specific hack for Windows) in front of the path, as described in the manual: http://libguestfs.org/guestfish.1.html#windows-paths For example:><fs> ls "/program files/windows nt/accessories"libguestfs: error: ls0: opendir: /program files/windows nt/accessories: No such file or directory><fs> ls "win:/program files/windows nt/accessories"mswrd6.wpc mswrd8.wpc wordpad.exe write.wpc><fs> set-trace true ><fs> ls "win:/program files/windows nt/accessories"libguestfs: trace: case_sensitive_path "/program files/windows nt/accessories" libguestfs: trace: case_sensitive_path = "/Program Files/Windows NT/Accessories" libguestfs: trace: ls "/Program Files/Windows NT/Accessories" libguestfs: trace: ls0 "/Program Files/Windows NT/Accessories" "/tmp/libguestfse0H7nF/ls10" libguestfs: trace: ls0 = 0 libguestfs: trace: ls = ["mswrd6.wpc", "mswrd8.wpc", "wordpad.exe", "write.wpc"] mswrd6.wpc mswrd8.wpc wordpad.exe write.wpc (notice the extra call to case_sensitive_path in the trace). Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html
Robert Nichols
2015-Nov-19 01:15 UTC
Re: [Libguestfs] [virt-tools-list] Paths with whitespace in guestfish
On 11/18/2015 08:22 AM, Richard W.M. Jones wrote: double quoting) is the correct one and works> fine for me: > >> <fs> ls "/Program Files/Windows NT/Accessories" > mswrd6.wpc > mswrd8.wpc > wordpad.exe > write.wpc > > I'm guessing it may be a case sensitivity problem. You could try > prepending 'win:...' (a guestfish-specific hack for Windows) in front > of the path, as described in the manual: > > http://libguestfs.org/guestfish.1.html#windows-paths > > For example: > >> <fs> ls "/program files/windows nt/accessories" > libguestfs: error: ls0: opendir: /program files/windows nt/accessories: No such file or directory > >> <fs> ls "win:/program files/windows nt/accessories" > mswrd6.wpc > mswrd8.wpc > wordpad.exe > write.wpc > >> <fs> set-trace true >> <fs> ls "win:/program files/windows nt/accessories" > libguestfs: trace: case_sensitive_path "/program files/windows nt/accessories" > libguestfs: trace: case_sensitive_path = "/Program Files/Windows NT/Accessories" > libguestfs: trace: ls "/Program Files/Windows NT/Accessories" > libguestfs: trace: ls0 "/Program Files/Windows NT/Accessories" "/tmp/libguestfse0H7nF/ls10" > libguestfs: trace: ls0 = 0 > libguestfs: trace: ls = ["mswrd6.wpc", "mswrd8.wpc", "wordpad.exe", "write.wpc"] > mswrd6.wpc > mswrd8.wpc > wordpad.exe > write.wpc > > (notice the extra call to case_sensitive_path in the trace).In "/Program Files" it works fine for me, too. I still can't access "/Users/Owner/My Documents" Aha!! I found the problem. In Windows 7, "My Documents" is a link to "Documents". Apparently guestfish can't follow links. I can list "/Users/Owner/Documents" just fine. The space was a red herring -- I can list "/Users/Owner/Saved Games" just fine, too. Thanks for the response. It got me looking at what was different between the directories that worked and those that didn't. -- Bob Nichols "NOSPAM" is really part of my email address. Do NOT delete it.