]>
git.saurik.com Git - apt.git/blob - apt-private/private-utils.cc
3 #include <apt-pkg/configuration.h>
4 #include <apt-pkg/fileutl.h>
5 #include "private-utils.h"
8 // DisplayFileInPager - Display File with pager /*{{{*/
9 void DisplayFileInPager(std::string filename
)
11 std::string pager
= _config
->Find("Dir::Bin::Pager",
12 "/usr/bin/sensible-pager");
14 pid_t Process
= ExecFork();
18 Args
[0] = pager
.c_str();
19 Args
[1] = filename
.c_str();
21 execvp(Args
[0],(char **)Args
);
25 // Wait for the subprocess
26 ExecWait(Process
, "sensible-pager", false);
30 // EditFileInSensibleEditor - Edit File with editor /*{{{*/
31 void EditFileInSensibleEditor(std::string filename
)
33 std::string editor
= _config
->Find("Dir::Bin::Editor",
34 "/usr/bin/sensible-editor");
36 pid_t Process
= ExecFork();
40 Args
[0] = editor
.c_str();
41 Args
[1] = filename
.c_str();
43 execvp(Args
[0],(char **)Args
);
47 // Wait for the subprocess
48 ExecWait(Process
, "sensible-editor", false);