]>
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>
15 static void callsystem(std::string
const &call
)
17 auto ret
= system(call
.c_str());
18 if (WIFEXITED(ret
) == false || WEXITSTATUS(ret
) != 0)
19 _error
->Error("Calling %s failed!", call
.c_str());
22 int main(int, char ** argv
)
24 auto const pid
= getpid();
26 strprintf(ls
, "ls -l /proc/%d/fd", pid
);
29 t
.Open(argv
[1], FileFd::ReadOnly
, FileFd::Extension
);
32 unsigned long long act
;
33 while (t
.Read(buf
, sizeof(buf
), &act
))
41 auto const ret
= _error
->PendingError();