removed generated file
[rrq/fusefile.git] / README.adoc
1 fusefile
2 ========
3
4 This project implements a "fuse" device to mount as a single file that
5 is a concatenation of fragments of one or more files. By default the
6 fused file is read-only.
7
8 A writeable fused file is set up by associating the mount with a
9 "scratch pad file"
10
11 FUSE file mount for combining file fragments.
12  
13 == SYNOPSIS
14  *fusefile* [_fuse options_] *mountpoint* _filename/from-to_ ...
15
16 ## DESCRIPTION
17
18 *fusefile* is FUSE file mount that presents a series of fragments of
19 other files as a contiguous concatenation. It bind mounts a driver on
20 top of the file mountpoint to present the nominated file fragments as
21 a single, contiguous file.
22
23 The fragment arguments include the filename of a source file, and
24 optionally start and end byte positions. All in all there five
25 variations:
26
27  * __filename__ include all of the file.
28
29  * __filename/__ include all of the file named with "/" in the pathname. This case requires a final "/", since the last "/" separates the filename from the position details.
30
31  * __filename/from__ include the file from the given start position, to end.
32
33  * __filename/-to__ include the file from beginning to the given end position (not included).
34
35  * __filename/from-to__ include the file from the given start position, up to the given end position (not included). 
36
37  * *pad=*_filename_ when this is given as first argument, the fused
38  file is set up as a writable random-access file, where the write
39  events are captured appended to the nominated "pad" file. The new
40  content is inserted into the fused file but not the original files,
41  and fragments are split up and adjusted as needed so as to make the
42  write events appear as insertions inteo the fused file.
43
44 ## EXAMPLES
45
46 Insert file "y" into file "x" at position 1200:
47   
48     $ fusefile -ononempty x x/-1200 y x/1200
49 The bind mount shadows the original file "x", and presents the
50 composite instead.
51
52 Make file y be a swap of the beginning and end of file "x", at
53 position 2442:
54
55     $ fusefile y x/2442 x/-2442
56
57 ## NOTES
58
59 Note that **fusefile** opens the nominated source file(s) before bind
60 mounting. With the fuse option __-ononempty__ it will bind over an
61 non-empty file, which may be useful. The source file descriptors
62 remain open, but the source fragments are not recomputed. If a source
63 file changes or reduces in size, anything may happen.
64
65 If the mountpoint file doesn't exist, then **fusefile** creates it,
66 and removes it when unmounted.
67
68 When a "pad" file is used, it is updated as a simple archive where
69 each write event is a new member appended at the end. Each "pad"
70 member has a prefix of two newline-terminated text lines telling the
71 insertion position and the member size (both as ascii decimal digits),
72 before the actual insertion event content.
73
74 ## AUTHOR
75
76 Ralph Rönnquist <ralph.ronnquist@gmail.com>