+libfuse 3.1.0 (UNRELEASED)
+==========================
+
+* Re-introduced examples/null.c.
+
+
libfuse 3.0.0 (2016-12-08)
==========================
/** @file
*
- * null.c - FUSE: Filesystem in Userspace
+ * This "filesystem" provides only a single file. The mountpoint
+ * needs to be a file rather than a directory. All writes to the
+ * file will be discarded, and reading the file always returns
+ * \0.
*
- * \section section_compile compiling this example
+ * Compile with:
*
- * gcc -Wall null.c `pkg-config fuse3 --cflags --libs` -o null
+ * gcc -Wall null.c `pkg-config fuse3 --cflags --libs` -o null
*
- * \section section_source the complete source
- * \include null.c
+ * ## Source code ##
+ * \include passthrough_fh.c
*/
else:
umount(mount_process, mnt_dir)
+def test_null(tmpdir):
+ mnt_file = str(tmpdir) + '/file'
+ with open(mnt_file, 'w') as fh:
+ fh.write('dummy')
+ cmdline = base_cmdline + [pjoin(basename, 'example', 'null'),
+ '-f', mnt_file ]
+ mount_process = subprocess.Popen(cmdline)
+ def test_fn(name):
+ return os.stat(name).st_size > 4000
+ try:
+ wait_for_mount(mount_process, mnt_file, test_fn)
+ with open(mnt_file, 'rb') as fh:
+ assert fh.read(382) == b'\0' * 382
+ with open(mnt_file, 'wb') as fh:
+ fh.write(b'whatever')
+ except:
+ cleanup(mnt_file)
+ raise
+ else:
+ umount(mount_process, mnt_file)
+
+
@pytest.mark.parametrize("name",
('notify_inval_inode',
'notify_store_retrieve'))