* Write the identifier as attribute to the file to make later checks possible.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30330 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-04-22 15:58:29 +00:00
parent 3b9dec1c07
commit 636ccbf306

View File

@ -18,7 +18,9 @@
#include <sys/stat.h>
#include <unistd.h>
#include <fs_attr.h>
#include <OS.h>
#include <TypeConstants.h>
enum file_action {
@ -50,6 +52,7 @@ typedef std::vector<entry> EntryVector;
const char* kDefaultBaseDir = "./random_file_temp";
const char* kIdentifierAttribute = "rfa:identifier";
const uint32 kDefaultDirCount = 1;
const uint32 kDefaultFileCount = 10;
@ -539,6 +542,9 @@ create_file(const EntryVector& dirs, EntryVector& files)
files.push_back(file);
fs_write_attr(fd, kIdentifierAttribute, B_UINT32_TYPE, 0, &file.identifier,
sizeof(uint32));
close(fd);
}