first ideas
This commit is contained in:
parent
efde4d363d
commit
564ff68fbb
|
@ -0,0 +1,24 @@
|
|||
/* Unix */
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#define GETCWD getcwd
|
||||
|
||||
|
||||
void getCurrentWorkDir(char *str,int *stat){
|
||||
if(GETCWD(str, sizeof(str)) == str){
|
||||
*stat = 0;
|
||||
}
|
||||
else{
|
||||
*stat = 1;
|
||||
}
|
||||
}
|
||||
|
||||
int isDirectory(const char *path){
|
||||
struct stat statbuf;
|
||||
if(stat(path, &statbuf) != 0)
|
||||
return 0;
|
||||
return S_ISDIR(statbuf.st_mode);
|
||||
}
|
|
@ -1237,8 +1237,7 @@ character(len=300) pure function IO_extractValue(pair,key)
|
|||
IO_extractValue = ''
|
||||
|
||||
myChunk = scan(pair,SEP)
|
||||
if (myChunk > 0 .and. pair(:myChunk-1) == key(:myChunk-1)) &
|
||||
IO_extractValue = pair(myChunk+1:) ! extract value if key matches
|
||||
if (myChunk > 0 .and. pair(:myChunk-1) == key) IO_extractValue = pair(myChunk+1:) ! extract value if key matches
|
||||
|
||||
end function IO_extractValue
|
||||
|
||||
|
|
Loading…
Reference in New Issue