don't use system("hey") but the Clean Way(tm).

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10489 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2004-12-19 00:25:04 +00:00
parent b03a7f8292
commit 8c0d307dcb
+10 -1
View File
@@ -7,6 +7,8 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <app/Message.h>
#include <app/Messenger.h>
#include <kernel/fs_attr.h>
#include <kernel/fs_info.h>
#include <storage/Directory.h>
@@ -17,6 +19,7 @@
#include <support/TypeConstants.h>
static const char *kAttrOriginalPath = "_trk/original_path";
static const char *kTrackerSig = "application/x-vnd.Be-TRAK";
int usage(int ret)
{
@@ -114,8 +117,14 @@ int main(int argc, char **argv)
return usage(0);
if (!dountrash && !strcmp(argv[1], "--empty")) {
/* XXX: clean that */
if (system("hey Tracker delete Trash"))
BMessage msg(B_DELETE_PROPERTY);
msg.AddSpecifier("Trash");
BMessenger msgr(kTrackerSig);
err = msgr.SendMessage(&msg);
if (err < 0) {
fprintf(stderr, "Emptying Trash: %s\n", strerror(err));
return 1;
}
return 0;
}
if (dountrash && !strcmp(argv[1], "--all")) {