我是Python和Fuse的新手。我在我的系统上运行着别人的保险丝代码。在
以下是启动程序的主要方法:
if __name__ == '__main__':
os.system('clear')
print "\n[*] Filesystem has been started.\n==============================================="
main(sys.argv[1], sys.argv[2])
这叫这个
^{2}$它(我现在知道)从Fuse调用init方法。。。What is happening when this code calls FUSE like this?
class FuseHandler(Operations):
'''
Class must implement reading a file, writing a file, and listing a directory.
POSIX calls will be redirected as such.
'''
def __init__(self, root):
self.root = realpath(root)
# Set up a working directory in case this is the first run
self.printStatus()
print '[-] End of Fuse init method: system initialized'
当我运行这个程序时,它一直运行到init方法的末尾,然后打印出来
"End of Fuse init method: system initialized."
但是光标会闪烁,就像Python期望输入一样。程序不会终止。它在干什么?在调用Fuse init之后,代码“go”在哪里?这是一个正在运行的保险丝控制台的样子吗?在
通过
FUSE(...)
调用,您将控制权交给FusePy库,该库必须保持程序运行(下面可能有一个事件分派循环);否则,如果FusePy库立即终止,程序如何继续响应Fuse文件操作请求(其实现在handler类中)?在相关问题 更多 >
编程相关推荐