1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-26 04:00:59 +01:00

Nix now understands the difference between runtime-state-components and non-runtime-state-compontens. Components and Derivations are now properly (re)build/derived (or not) when necessary.

This commit is contained in:
Wouter den Breejen 2007-06-08 16:00:55 +00:00
parent fd2b8271e4
commit 267ccc589d
8 changed files with 135 additions and 66 deletions

View file

@ -18,6 +18,7 @@
#include <sys/types.h>
#include <fcntl.h>
extern char * * environ;
@ -1071,5 +1072,25 @@ string time_t2string(const time_t & t)
string s = int2String(i);
return s;
}
bool FileExist(const string FileName)
{
const char* FileName_C = FileName.c_str();
//strcpy(FileName_C, FileName.c_str());
struct stat my_stat;
return (stat(FileName_C, &my_stat) == 0);
}
bool IsDirectory(const string FileName)
{
const char* FileName_C = FileName.c_str();
//strcpy(FileName_C, FileName.c_str());
struct stat my_stat;
if (stat(FileName_C, &my_stat) != 0) return false;
return ((my_stat.st_mode & S_IFDIR) != 0);
}
}