]>
git.saurik.com Git - apt.git/blob - test/interactive-helper/test_fileutl.cc
1 #include <apt-pkg/fileutl.h>
2 #include <apt-pkg/strutl.h>
3 #include <apt-pkg/error.h>
14 static void callsystem(std::string
const &call
)
16 auto ret
= system(call
.c_str());
17 if (WIFEXITED(ret
) == false || WEXITSTATUS(ret
) != 0)
18 _error
->Error("Calling %s failed!", call
.c_str());
21 int main(int, char ** argv
)
23 auto const pid
= getpid();
25 strprintf(ls
, "ls -l /proc/%d/fd", pid
);
28 t
.Open(argv
[1], FileFd::ReadOnly
, FileFd::Extension
);
31 unsigned long long act
;
32 while (t
.Read(buf
, sizeof(buf
), &act
))
40 auto const ret
= _error
->PendingError();