summaryrefslogtreecommitdiffstats
path: root/fuse/test-fuse.sh
diff options
context:
space:
mode:
authorRichard Jones <rjones@redhat.com>2010-05-18 21:51:05 +0100
committerRichard Jones <rjones@redhat.com>2010-05-20 10:30:12 +0100
commit3920ad95f6b2db8fbf20aa26692877a09070cb04 (patch)
treeeb3ffe5779f720c96a33506d1b50807c430ca977 /fuse/test-fuse.sh
parentbda6cf75f259992bcba23c3c4c2339c50552f491 (diff)
downloadlibguestfs-3920ad95f6b2db8fbf20aa26692877a09070cb04.tar.gz
libguestfs-3920ad95f6b2db8fbf20aa26692877a09070cb04.tar.xz
libguestfs-3920ad95f6b2db8fbf20aa26692877a09070cb04.zip
New API: write for creating files with fixed content (RHBZ#501889).
The guestfs_write call can be used to create small files with arbitrary 8 bit content, including \0 bytes. This replaces and deprecates write-file, which cannot be modified to use BufferIn because of an unfortunate choice in the ABI: the size parameter to write-file, if zero, means that the daemon tries to calculate the length of the buffer using strlen. However this fails if we pass a zero-length buffer using BufferIn because then the daemon tries to do strlen on a (really) zero length buffer, not even containing a terminating \0 character, thus segfaulting.
Diffstat (limited to 'fuse/test-fuse.sh')
-rwxr-xr-xfuse/test-fuse.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/fuse/test-fuse.sh b/fuse/test-fuse.sh
index 7dc8e4b8..e31ea9d7 100755
--- a/fuse/test-fuse.sh
+++ b/fuse/test-fuse.sh
@@ -93,8 +93,8 @@ $guestfish <<EOF
part-disk /dev/sda mbr
mkfs ext2 /dev/sda1
mount /dev/sda1 /
- write-file /hello.txt hello 0
- write-file /world.txt "hello world" 0
+ write /hello.txt hello
+ write /world.txt "hello world"
touch /empty
EOF