Lines Matching refs:dir
43 PetscErrorCode PetscMkdir(const char dir[]) in PetscMkdir() argument
49 PetscCall(PetscTestDirectory(dir, 'w', &flg)); in PetscMkdir()
52 err = _mkdir(dir); in PetscMkdir()
54 err = mkdir(dir, S_IRWXU | S_IRGRP | S_IXGRP); in PetscMkdir()
56 PetscCheck(!err, PETSC_COMM_SELF, PETSC_ERR_FILE_UNEXPECTED, "Could not create dir: %s", dir); in PetscMkdir()
70 PetscErrorCode PetscMkdtemp(char dir[]) in PetscMkdtemp() argument
81 PetscCall(PetscStrncpy(name, dir, sizeof(name))); in PetscMkdtemp()
84 …M_SELF, PETSC_ERR_FILE_UNEXPECTED, "Could not generate a unique name using the template: %s", dir); in PetscMkdtemp()
88 …_UNEXPECTED, "Exceeds maximum retry time when creating temporary dir using the template: %s", dir); in PetscMkdtemp()
89 PetscCall(PetscStrncpy(dir, name, len + 1)); in PetscMkdtemp()
92 dir = mkdtemp(dir); in PetscMkdtemp()
93 PetscCheck(dir, PETSC_COMM_SELF, PETSC_ERR_FILE_UNEXPECTED, "Could not create temporary dir"); in PetscMkdtemp()
99 PetscErrorCode PetscRMTree(const char dir[]) in PetscRMTree() argument
111 PetscCall(PetscPathJoin(dir, "*", PETSC_MAX_PATH_LEN, loc)); in PetscRMTree()
116 …ck(!flg, PETSC_COMM_SELF, PETSC_ERR_FILE_UNEXPECTED, "Cannot access directory to delete: %s", dir); in PetscRMTree()
118 …!flg, PETSC_COMM_SELF, PETSC_ERR_FILE_UNEXPECTED, "Specified path is a file - not a dir: %s", dir); in PetscRMTree()
125 PetscCall(PetscPathJoin(dir, data.name, PETSC_MAX_PATH_LEN, loc)); in PetscRMTree()
133 …PetscCheck(!_rmdir(dir), PETSC_COMM_SELF, PETSC_ERR_FILE_UNEXPECTED, "Could not delete dir: %s", d… in PetscRMTree()
151 PetscErrorCode PetscRMTree(const char dir[]) in PetscRMTree() argument
160 dirp = opendir(dir); in PetscRMTree()
163 PetscCall(PetscTestDirectory(dir, 'r', &flg)); in PetscRMTree()
164 …ck(!flg, PETSC_COMM_SELF, PETSC_ERR_FILE_UNEXPECTED, "Cannot access directory to delete: %s", dir); in PetscRMTree()
165 PetscCall(PetscTestFile(dir, 'r', &flg)); in PetscRMTree()
166 …!flg, PETSC_COMM_SELF, PETSC_ERR_FILE_UNEXPECTED, "Specified path is a file - not a dir: %s", dir); in PetscRMTree()
173 PetscCall(PetscPathJoin(dir, data->d_name, PETSC_MAX_PATH_LEN, loc)); in PetscRMTree()
182 …PetscCheck(!rmdir(dir), PETSC_COMM_SELF, PETSC_ERR_FILE_UNEXPECTED, "Could not delete dir: %s due … in PetscRMTree()