editorial
[rrq/fusefile.git] / README.adoc
index a37d36d40c0e75d2409119e781fbc24923afe4e6..500e81bb528e3abffbff7e2c968a738ec75b5fc4 100644 (file)
@@ -2,16 +2,17 @@ fusefile
 ========
 
 This project implements a "fuse" device to mount as a single file that
-is a concatenation of fragments of one or more files. By default the
-fused file is read-only.
-
-A writeable fused file is set up by associating the mount with a
-"scratch pad file"
+is a concatenation of fragments of one or more files. The fused file
+allows overwriting the parts files, but not changing their sizes, and
+only for parts files that are writable upon first access.
 
 FUSE file mount for combining file fragments.
  
 == SYNOPSIS
- *fusefile* [_fuse options_] *mountpoint* _filename/from-to_ ...
+
+====
+*fusefile* [ _fuse options_ ] *mountpoint*  +_filename_/from:to+ ...
+====
 
 ## DESCRIPTION
 
@@ -32,27 +33,35 @@ variations:
 
  * __filename/-to__ include the file from beginning to the given end position (not included).
 
- * __filename/from-to__ include the file from the given start position, up to the given end position (not included). 
-
- * *pad=*_filename_ when this is given as first argument, the fused
- file is set up as a writable random-access file, where the write
- events are captured appended to the nominated "pad" file. The new
- content is inserted into the fused file but not the original files,
- and fragments are split up and adjusted as needed so as to make the
- write events appear as insertions inteo the fused file.
+ * __filename/from:to__ include the file from the given start position, up to the given end position (not included). 
 
 ## EXAMPLES
 
-Insert file "y" into file "x" at position 1200:
+.Insert file "y" into file "x" at position 1200:
   
-    $ fusefile -ononempty x x/-1200 y x/1200
-The bind mount shadows the original file "x", and presents the
-composite instead.
+    $ fusefile -ononempty x x/:1200 y x/1200:
+
+That mount will shadow the original file "x", and presents the
+fused file instead.
+
+.Make file y be a swap of the beginning and end of file "x", at position 2442:
+
+    $ fusefile y x/2442: x/:2442
+
+.Replace a partition in an image file with a different file
 
-Make file y be a swap of the beginning and end of file "x", at
-position 2442:
+    $ partx -oNR,START,SECTORS disk.raw
+    NR   START  SECTORS
+     1    2048  2097152
+     2 2099200   409600
+     3 2508800 14268383
+    # Replace partition 2 of 409600 sectors from 2099200 with
+    # the file "insert.fat" clipped to 409600 sectors.
+    $ fusefile -ononempty disk.raw \
+         disk.raw/0:$(( 2099200*512 )) \
+         insert.fat/0:$(( 409600*512 )) \
+         disk.raw/$(( (2099200+409600)*512 )):
 
-    $ fusefile y x/2442 x/-2442
 
 ## NOTES
 
@@ -60,16 +69,13 @@ Note that **fusefile** opens the nominated source file(s) before bind
 mounting. With the fuse option __-ononempty__ it will bind over an
 non-empty file, which may be useful. The source file descriptors
 remain open, but the source fragments are not recomputed. If a source
-file changes or reduces in size, anything may happen.
+file changes or reduces in size "behind" the fused file, then anything
+may happen.
 
-If the mountpoint file doesn't exist, then **fusefile** creates it,
-and removes it when unmounted.
+If the mountpoint file doesn't exist, then **fusefile** creates it and
+removes it when unmounted.
 
-When a "pad" file is used, it is updated as an "ar" archive where each
-write event is a new member appended at the end. The "pad" member has
-two additional, newline-terminated text lines with the insertion
-position and the member size (ascii decimal digits), before the actual
-insertion event content.
+Unmounting is done with "fusermount -u __fused file__" as usual.
 
 ## AUTHOR