我正在尝试通过 s3fs 使用 RC4 对文件进行加密,需要用文件描述符提取文件名并执行操作。那么在 C++ 中应该如何实现呢?
由于我不知道如何开始,因此没有代码可供展示,但大致实现过程如下:
void foo(int fd){
// something
string temp;
temp = // result of that somethingthing;
ifstream in;
in.open(temp,ios::binary | ios::in);
}
这个可行吗?还是说我注定要使用系统调用?
std::string
,再转换为std::stringstream
,也许可以这样做? - tadman