]>
git.saurik.com Git - apt.git/blob - apt-private/private-utils.cc
3 #include <apt-pkg/configuration.h>
4 #include <apt-pkg/fileutl.h>
6 #include <apt-private/private-utils.h>
11 // DisplayFileInPager - Display File with pager /*{{{*/
12 void DisplayFileInPager(std::string filename
)
14 std::string pager
= _config
->Find("Dir::Bin::Pager",
15 "/usr/bin/sensible-pager");
17 pid_t Process
= ExecFork();
21 Args
[0] = pager
.c_str();
22 Args
[1] = filename
.c_str();
24 execvp(Args
[0],(char **)Args
);
28 // Wait for the subprocess
29 ExecWait(Process
, "sensible-pager", false);
32 // EditFileInSensibleEditor - Edit File with editor /*{{{*/
33 void EditFileInSensibleEditor(std::string filename
)
35 std::string editor
= _config
->Find("Dir::Bin::Editor",
36 "/usr/bin/sensible-editor");
38 pid_t Process
= ExecFork();
42 Args
[0] = editor
.c_str();
43 Args
[1] = filename
.c_str();
45 execvp(Args
[0],(char **)Args
);
49 // Wait for the subprocess
50 ExecWait(Process
, "sensible-editor", false);