Browse Source

Change fjfs command line parameters places.

Before calling convention was "fjfs filelist.txt mount-point" now
it is "fjfs mount-point filelist.txt".

This is done in preparation for using files listed on the command
line instead of reading filelist.txt.
Georgi Chorbadzhiyski 12 years ago
parent
commit
d0d197c139
4 changed files with 10 additions and 20 deletions
  1. 5
    8
      README
  2. 3
    3
      fjfs.c
  3. 1
    5
      test/mount.sh
  4. 1
    4
      test/umount.sh

+ 5
- 8
README View File

@@ -11,16 +11,13 @@ To use it:
11 11
            echo /etc/issue >> filelist.txt
12 12
            echo /etc/passwd >> filelist.txt
13 13
 
14
-     3. Create an empty file over which the files in the list will be joined
15
-           touch joined.txt
14
+     3. Mount fjfs
15
+           ./fjfs joined.txt filelist.txt
16 16
 
17
-     4. Mount fjfs
18
-           ./fjfs filelist.txt joined.txt
19
-
20
-     5. Check the result with
17
+     4. Check the result with
21 18
            cat joined.txt
22 19
 
23 20
         You will see the contents of all the files listed in filelist.txt
24 21
 
25
-     6. Unmount the fs
26
-           fusermount -u joined.txt
22
+     5. Unmount the fs
23
+           fusermount -u joined.txt && rm joined.txt

+ 3
- 3
fjfs.c View File

@@ -241,12 +241,12 @@ int main(int argc, char *argv[]) {
241 241
 	struct stat sb;
242 242
 
243 243
 	if (argc < 3) {
244
-		fprintf(stderr, "Usage: %s filelist.txt mount-point-file\n", argv[0]);
244
+		fprintf(stderr, "Usage: %s mount-point-file filelist.txt\n", argv[0]);
245 245
 		exit(EXIT_FAILURE);
246 246
 	}
247 247
 
248
-	filenames  = argv[1];
249
-	mountpoint = argv[2];
248
+	mountpoint = argv[1];
249
+	filenames  = argv[2];
250 250
 
251 251
 	if (stat(mountpoint, &sb) == -1) {
252 252
 		FILE *f = fopen(mountpoint, "wb");

+ 1
- 5
test/mount.sh View File

@@ -1,8 +1,4 @@
1 1
 #!/bin/sh
2 2
 
3
-set -e
4
-
5
-ulimit -c unlimited
6
-touch testmnt.txt
7
-../fjfs test.txt testmnt.txt
3
+../fjfs testmnt.txt test.txt
8 4
 

+ 1
- 4
test/umount.sh View File

@@ -1,6 +1,3 @@
1 1
 #!/bin/sh
2 2
 
3
-set -e
4
-
5
-fusermount -u testmnt.txt
6
-rm testmnt.txt
3
+fusermount -u testmnt.txt && rm testmnt.txt

Loading…
Cancel
Save