34 #include <gwenhywfar/directory.h>
35 #include <gwenhywfar/debug.h>
36 #include <gwenhywfar/path.h>
37 #include <gwenhywfar/buffer.h>
38 #include <gwenhywfar/text.h>
43 #ifdef HAVE_SYS_STAT_H
44 # include <sys/stat.h>
46 #include <sys/types.h>
77 if (entry && isalpha(*entry)) {
82 if ( (len==2) && (entry[1] ==
':') ) {
92 if (strcasecmp(entry,
"..")==0) {
131 if (!S_ISREG(st.st_mode)) {
138 if (!S_ISDIR(st.st_mode)) {
171 fd=open(p, O_RDWR | O_CREAT | O_TRUNC,
181 fd=open(p, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
221 unsigned int flags) {
242 int transformDriveElement){
249 if (transformDriveElement) {
252 if (p[2]==
'/' || p[2]==0) {
261 if (*p==
'/' || *p==
'\\') {
262 while (*p==
'/' || *p==
'\\')
282 const char *filePath,
301 "File \"%s\" found in folder \"%s\"",
320 const char *filePath,
339 "File \"%s\" found in folder \"%s\"",
363 tmp_dir = getenv (
"TMPDIR");
365 tmp_dir = getenv (
"TMP");
367 tmp_dir = getenv (
"TEMP");
378 strncpy (buffer, tmp_dir, size);
400 if (strcmp(buffer,
".")!=0 &&
401 strcmp(buffer,
"..")!=0 &&
437 if (strcmp(buffer,
".")!=0 &&
438 strcmp(buffer,
"..")!=0 &&
445 if (S_ISREG(st.st_mode))
447 else if (S_ISDIR(st.st_mode))
487 if (strcmp(buffer,
".")!=0 &&
488 strcmp(buffer,
"..")!=0 &&
495 if (S_ISREG(st.st_mode))
532 if (strcmp(buffer,
".")!=0 &&
533 strcmp(buffer,
"..")!=0 &&
540 if (S_ISDIR(st.st_mode))
581 if (strcmp(buffer,
".")!=0 &&
582 strcmp(buffer,
"..")!=0) {
587 if (S_ISDIR(st.st_mode))
628 if (getcwd(savedPwd,
sizeof(savedPwd)-1)==
NULL) {
639 if (getcwd(dataPwd,
sizeof(dataPwd)-1)==
NULL) {
643 dataPwd[
sizeof(dataPwd)-1]=0;
646 if (chdir(savedPwd)) {