对文件系统目录树的简单面向对象访问
FS-Hopper的Python项目详细描述
===
fs hopper
==
只有两个已知的文件系统节点是目录和树。这两个
都作为新样式的类实现。对它们的每个方法调用(例如
directorynode.get_childs())都将返回
directorynode或filenode的实例,允许在整个
树中轻松遍历。
禁止在set-root上创建节点,这样您就可以轻松地将代码放入
文件系统中的某个目录中。
=
=
usage
=
=
jail code into/tmp并创建工作目录:
/usr/bin/env python2
import fs_hopper
fs_hopper.set_root('/tmp')
workdir.mkdir()
print workdir
/usr/bin/env python2
import os
import fs_hopper
confdir=fs_hopper.directory(name)
confs=confdir.get_subs('*.conf')
print confs
/usr/bin/env python2
import fs_hopper
打印passwd.get_content()
===
资源
==
-pypi:https://pypi.python.org/pypi/fs-hopper/
fs hopper
==
都作为新样式的类实现。对它们的每个方法调用(例如
directorynode.get_childs())都将返回
directorynode或filenode的实例,允许在整个
树中轻松遍历。
禁止在set-root上创建节点,这样您就可以轻松地将代码放入
文件系统中的某个目录中。
=
=
usage
=
=
jail code into/tmp并创建工作目录:
/usr/bin/env python2
import fs_hopper
fs_hopper.set_root('/tmp')
print workdir
/usr/bin/env python2
import os
import fs_hopper
confs=confdir.get_subs('*.conf')
print confs
/usr/bin/env python2
import fs_hopper
===
资源
==