我需要使用我的参数运行 linux 'read' 系统调用。有什么想法吗?
read(const char *path, char *buf, size_t size, off_t offset,struct fuse_file_info *fi)
我需要用我的参数调用上面的函数。
最佳答案
Python 公开 the C stdlib read()
function作为os.read()
function :
os.read(fd, n)
Read at most n bytes from file descriptor fd. Return a string containing the bytes read. If the end of the file referred to by fd has been reached, an empty string is returned.
错误作为 OSError
异常引发,errno
属性设置为整数,如 C read()
文档中所述。您可以使用 errno
module如果您想要测试常量。
关于python - 如何用python调用 'read'系统调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24513946/