39 void gp_port_win_convert_path (
char *path) {
43 if (strchr(path,
'\\'))
56 for (x=0; x<strlen(path); x++)
63 if (_mkdir(dirname) < 0)
70 if (_rmdir(dirname) < 0)
82 d = (GPPORTWINDIR*)malloc(
sizeof(GPPORTWINDIR));
83 d->handle = INVALID_HANDLE_VALUE;
85 strcpy(d->dir, dirname);
89 dr = GetLogicalDrives();
91 for (x=0; x<32; x++) {
92 if ((dr >> x) & 0x0001) {
93 sprintf(d->drive[d->drive_count],
"%c",
'A' + x);
105 if (strcmp(d->dir,
"/")==0) {
106 if (d->drive_index == d->drive_count)
108 strcpy(d->search.cFileName, d->drive[d->drive_index]);
110 return (&(d->search));
116 strcpy(dirn, d->dir);
117 gp_port_win_convert_path(dirn);
119 if (dirn[strlen(dirn)-1] !=
'\\')
124 if (d->handle == INVALID_HANDLE_VALUE) {
125 d->handle = FindFirstFile(dirn, &(d->search));
126 if (d->handle == INVALID_HANDLE_VALUE)
129 if (!FindNextFile(d->handle, &(d->search)))
133 return (&(d->search));
138 return (de->cFileName);
142 FindClose(d->handle);
151 gp_port_win_convert_path(filename);
153 if (stat(filename, &st)!=0)
155 return (st.st_mode & _S_IFREG);
162 if (strlen(dirname) <= 3)
165 gp_port_win_convert_path(dirname);
167 if (stat(dirname, &st)!=0)
169 return (st.st_mode & _S_IFDIR);
184 if (mkdir(dirname, 0777)<0)
199 if (rmdir (dirname) < 0)
215 return (opendir(dirname));
269 if (stat(filename, &st)!=0)
271 return (!S_ISDIR(st.st_mode));
286 if (stat(dirname, &st)!=0)
288 return (S_ISDIR(st.st_mode));