mirror of
https://github.com/NixOS/nix
synced 2025-06-27 12:41:15 +02:00
* Automatically upgrade <= 0.7 Nix stores to the new schema (so that
existing user environments continue to work). * `nix-store --verify': detect incomplete closures.
This commit is contained in:
parent
c547439843
commit
582e01c06f
8 changed files with 154 additions and 23 deletions
|
@ -185,6 +185,15 @@ string readFile(const Path & path)
|
|||
}
|
||||
|
||||
|
||||
void writeFile(const Path & path, const string & s)
|
||||
{
|
||||
AutoCloseFD fd = open(path.c_str(), O_WRONLY | O_TRUNC | O_CREAT, 0666);
|
||||
if (fd == -1)
|
||||
throw SysError(format("opening file `%1%'") % path);
|
||||
writeFull(fd, (unsigned char *) s.c_str(), s.size());
|
||||
}
|
||||
|
||||
|
||||
static void _deletePath(const Path & path)
|
||||
{
|
||||
checkInterrupt();
|
||||
|
|
|
@ -94,6 +94,9 @@ Strings readDirectory(const Path & path);
|
|||
string readFile(int fd);
|
||||
string readFile(const Path & path);
|
||||
|
||||
/* Write a string to a file. */
|
||||
void writeFile(const Path & path, const string & s);
|
||||
|
||||
/* Delete a path; i.e., in the case of a directory, it is deleted
|
||||
recursively. Don't use this at home, kids. */
|
||||
void deletePath(const Path & path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue