summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-06-03 20:26:37 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-06-03 20:26:37 +0000
commitc43a1bbcf7c1240f2d3904b5c5b13d1621332ed6 (patch)
tree4e2a25fbb124b6abaf82c4b289422907ecddd45e /bin
parent03b30261f65ca8696e026aa488d0445b38bb7fed (diff)
downloadATCD-c43a1bbcf7c1240f2d3904b5c5b13d1621332ed6.tar.gz
Process modules for perl scripts.
Diffstat (limited to 'bin')
-rw-r--r--bin/Process.pm12
-rw-r--r--bin/Process_Unix.pm35
-rw-r--r--bin/Process_Win32.pm29
3 files changed, 76 insertions, 0 deletions
diff --git a/bin/Process.pm b/bin/Process.pm
new file mode 100644
index 00000000000..46deb2f572e
--- /dev/null
+++ b/bin/Process.pm
@@ -0,0 +1,12 @@
+$inc = "Process_Unix.pm";
+$DIR_SEPARATOR = "/";
+
+if ($^O eq "MSWin32")
+{
+ $inc = "Process_Win32.pm";
+ $DIR_SEPARATOR = "\\";
+}
+
+require $inc;
+
+1; \ No newline at end of file
diff --git a/bin/Process_Unix.pm b/bin/Process_Unix.pm
new file mode 100644
index 00000000000..0537074dbb7
--- /dev/null
+++ b/bin/Process_Unix.pm
@@ -0,0 +1,35 @@
+package Process;
+
+$EXE_EXT = "";
+
+sub Create
+{
+ my $name = shift;
+ my $args = shift;
+ my $self = [];
+ unless ($self->[0] = fork ())
+ {
+ unless (fork ())
+ {
+ exec $name." ".$args;
+ die "no exec";
+ }
+ exit 0;
+ }
+ bless $self;
+}
+
+sub Kill
+{
+ my $self = shift;
+ kill (1, $self->[0]);
+}
+
+sub Wait
+{
+ my $self = shift;
+ waitpid ($self->[0], 0);
+}
+
+
+1;
diff --git a/bin/Process_Win32.pm b/bin/Process_Win32.pm
new file mode 100644
index 00000000000..bf850022d03
--- /dev/null
+++ b/bin/Process_Win32.pm
@@ -0,0 +1,29 @@
+package Process;
+
+use Win32::Process;
+
+$EXE_EXT = ".exe";
+
+sub Create
+{
+ my $name = shift;
+ my $args = shift;
+ my $self = [];
+ Win32::Process::Create ($self->[0], $name, $name." ".$args, 0,
+ CREATE_NEW_CONSOLE, ".");
+ bless $self;
+}
+
+sub Kill
+{
+ my $self = shift;
+ Win32::Process::Kill ($self->[0], -1);
+}
+
+sub Wait
+{
+ my $self = shift;
+ Win32::Process::Wait ($self->[0], INFINITE);
+}
+
+1; \ No newline at end of file