⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filesystem.h

📁 GiPS是一个面向数据密集型应用的分布式文件系统
💻 H
字号:
#pragma once
#include <Ice/Ice.h>
#include <stdio.h>
#include "ClientMaster.h"
#include "ClientClerk.h"
#include <fstream>
#include <string>
#include <iostream>
using namespace std;

/**
* 每次写入和读出的最大值64M
*/
const int MAX_BUFFER = 1024*1024*64;

/**
*定义文件句柄
*/
typedef struct Handle{
	::ClientMaster::desIPList desIPs;
	::ClientClerk::FileIOManagerPrx curIOManager;
	::std::string curBlockIndex; 
	::ClientMaster::FileObject fileObj;
	int curPos;
};
/**
* 显示当前文件目录
*/
bool ls();

/**
* 创建文件夹
*/
bool mkdir(string folderName);

/**
* 删除文件夹
*/
bool rmdir(string folderName);

/**
* 删除文件
*/
bool rmfile(string fileName);

/**
* 打开文件
*/
Handle* open(string fileName, int mode);

/**
*文件定位
*/
void seek(Handle* handle,int offset,int tag);

/**
* 写文件
*/
int write(Handle* handle,unsigned char* data,int size);

/**
* 读文件
*/
int read(Handle* handle,unsigned char* data,int size);

/**
* 关闭文件
*/
bool close(Handle* handle);

/**
*以下全为dfs的需要,非标准接口
*/
void updateMasterFS(const string fileName,const ::ClientMaster::FileObject& fileObj);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -