C++文件操作判断文件是否存在和文件大小

2014-10-23 17:30:03 · 作者: · 浏览: 72


  编译和运行环境是在VC++6.0,File.h如下:


  #ifndef _FILE_H


  #define _FILE_H


  #include


  namespace zpp


  {


  class File {


  private:


  std::string fileName;


  public:


  File(const std::string& aFileName);


  ~File();


  bool exist();


  bool isDirectory();


  long getFileSize();


  char getFileDrive();


  std::string getCreateTime();


  std::string getModifiedTime();


  };


  }