| 197 | } |
| 198 | |
| 199 | Str *CurrentDir() { |
| 200 | #ifdef PATH_MAX |
| 201 | char *path = getcwd(NULL, PATH_MAX); |
| 202 | #else |
| 203 | char *path = getcwd(NULL, 8192); |
| 204 | #endif |
| 205 | Str *result = new Str(path); |
| 206 | free(path); |
| 207 | return result; |
| 208 | } |
| 209 | |
| 210 | bool ChDir(const char *path) { |
| 211 | return !chdir(path); |