File: README.zh_CN.UTF-8

package info (click to toggle)
fuse-convmvfs 0.2.6-2
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye, buster, jessie, jessie-kfreebsd, sid, stretch, trixie, wheezy
  • size: 456 kB
  • ctags: 86
  • sloc: sh: 1,032; cpp: 642; makefile: 22
file content (101 lines) | stat: -rw-r--r-- 3,894 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
摘要
==

本软件是一个基于FUSE(Filesystem in USErspace)的用户态文件系统, 用于
将文件系统树中的一个分支的文件名的编码映射为另一种编码,并且将其装载在
一个其他装载点下。


动机
==

Convmv(http://osx.freshmeat.net/projects/convmv/)是一个现有的用于转换
文件名编码的小工具。 受这个软件的启发,开发出了convmvfs,一个用于转换
文件名编码的文件系统。

一个实用的例子:在中国,计算机系统中广泛使用一种国家标准GB2312来存储中
文,这种习惯导致了很多中文软件的ftp客户端只识别远端服务器上的GB2312编
码的文件名。然而现在用于架设ftp服务器的*nix系统越来越倾向于使用UTF-8编
码来存储文件名。为了解决这个问题,使用本软件,可以达到这样的效果:假设
一个FTP服务器将/ftp/目录设置为匿名用户登录的ftp根目录,并且其下的文
件名是UTF-8编码的,为了让windows上的只能识别GB2312编码的客户端能够正常
访问ftp,可以用convmvfs软件将/ftp/pub_gbk映射/ftp/pub目录,任何访问
/ftp/pub_gbk目录的都将得到GB2312编码的文件名,但是文件内容将保持无变化。


安装
==

本软件需要你的系统安装有FUSE 2.5或者更高的版本,FUSE可以从这里得到:

  http://fuse.sourceforge.net

成功安装和配置FUSE后,在convmvfs的目录下执行下列命令:

  ./configure
  make
  make install (as root)

这样就安装完毕了。你可以执行convmvfs --help得到帮助信息。

如果你是从cvs中得到最新软件, 你需要首先执行'autoreconf -iv'。


如何使用
====

一旦convmvfs被安装,运行是相当简单的:
usage: convmvfs mountpoint [options]

general options:
    -o opt,[opt...]        mount options
    -h   --help            print help
    -V   --version         print version

FUSE options:
    -d   -o debug          enable debug output (implies -f)
    -f                     foreground operation
    -s                     disable multi-threaded operation

    -o allow_other         allow access to other users
    -o allow_root          allow access to root
    -o nonempty            allow mounts over non-empty file/dir
    -o default_permissions enable permission checking by kernel
    -o fsname=NAME         set filesystem name
    -o large_read          issue large read requests (2.4 only)
    -o max_read=N          set maximum size of read requests

    -o hard_remove         immediate removal (don't hide files)
    -o use_ino             let filesystem set inode numbers
    -o readdir_ino         try to fill in d_ino in readdir
    -o direct_io           use direct I/O
    -o kernel_cache        cache files in kernel
    -o umask=M             set file permissions (octal)
    -o uid=N               set file owner
    -o gid=N               set file group
    -o entry_timeout=T     cache timeout for names (1.0s)
    -o negative_timeout=T  cache timeout for deleted names (0.0s)
    -o attr_timeout=T      cache timeout for attributes (1.0s)

CONVMVFS options:
    -o srcdir=PATH         which directory to convert
    -o icharset=CHARSET    charset used in srcdir
    -o ocharset=CHARSET    charset used in mounted filesystem

注意:
* 如果你使用普通用户运行软件,首先需要确定是否有读写权限于/dev/fuse文
件。

* 使用'iconv --list'可以看到软件支持哪些编码。

* 使用allow_other选项可以让其他用户访问文件系统。

* 重要:srcdir和文件系统挂载点不能是同一个文件夹,否则文件操作将陷入
不可中断的死循环。一定要避免这种情形。

运行实例:
* 挂载文件系统
$convmvfs /ftp/pub_gbk -o srcdir=/ftp/pub, icharset=utf8,ocharset=gbk

* 卸载文件系统
$fusermount -u /ftp/pub_gbk