| 151 | } |
| 152 | |
| 153 | FileNodeRef PosixFileSystem::resolve(const Path& path) |
| 154 | { |
| 155 | String file = buildFileName(_volume,path); |
| 156 | struct stat info; |
| 157 | |
| 158 | #ifdef TORQUE_POSIX_PATH_CASE_INSENSITIVE |
| 159 | // Resolve the case sensitive filepath |
| 160 | String::SizeType fileLength = file.length(); |
| 161 | UTF8* caseSensitivePath = new UTF8[fileLength + 1]; |
| 162 | dMemcpy(caseSensitivePath, file.c_str(), fileLength); |
| 163 | caseSensitivePath[fileLength] = 0x00; |
| 164 | ResolvePathCaseInsensitive(caseSensitivePath, fileLength, false); |
| 165 | String caseSensitiveFile(caseSensitivePath); |
| 166 | #else |
| 167 | String caseSensitiveFile = file; |
| 168 | #endif |
| 169 | |
| 170 | FileNodeRef result = 0; |
| 171 | if (stat(caseSensitiveFile.c_str(),&info) == 0) |
| 172 | { |
| 173 | // Construct the appropriate object |
| 174 | if (S_ISREG(info.st_mode)) |
| 175 | result = new PosixFile(path,caseSensitiveFile); |
| 176 | |
| 177 | if (S_ISDIR(info.st_mode)) |
| 178 | result = new PosixDirectory(path,caseSensitiveFile); |
| 179 | } |
| 180 | |
| 181 | #ifdef TORQUE_POSIX_PATH_CASE_INSENSITIVE |
| 182 | delete[] caseSensitivePath; |
| 183 | #endif |
| 184 | |
| 185 | return result; |
| 186 | } |
| 187 | |
| 188 | FileNodeRef PosixFileSystem::create(const Path& path, FileNode::Mode mode) |
| 189 | { |
nothing calls this directly
no test coverage detected