Lines Matching defs:path
122 void CanonicalizePath(string* path, uint64_t* slash_bits) {
123 size_t len = path->size();
126 str = &(*path)[0];
128 path->resize(len);
139 void CanonicalizePath(char* path, size_t* len, uint64_t* slash_bits) {
146 char* start = path;
157 // Windows network path starts with //
278 // Remove trailing path separator if any, but keep the initial
279 // path separator(s) if there was one (or two on Windows).
413 int ReadFile(const string& path, string* contents, string* err) {
418 HANDLE f = ::CreateFileA(path.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL,
441 FILE* f = fopen(path.c_str(), "rb");
593 std::pair<int64_t, bool> readCount(const std::string& path) {
594 std::ifstream file(path.c_str());
643 string translate(string& path) const {
644 // path must be sub dir of root
645 if (path.compare(0, root.len_, root.str_, root.len_) != 0) {
648 path.erase(0, root.len_);
649 if (path == ".." || (path.length() > 2 && path.compare(0, 3, "../") == 0)) {
652 return mountPoint.AsString() + "/" + path;
938 bool Truncate(const string& path, size_t size, string* err) {
940 int fh = _sopen(path.c_str(), _O_RDWR | _O_CREAT, _SH_DENYNO,
945 int success = truncate(path.c_str(), size);