Package com.glitchybyte.glib.process
Class GOSWindows
java.lang.Object
com.glitchybyte.glib.process.GOSInterface
com.glitchybyte.glib.process.GOSWindows
Specialization of GOSInterface for Windows.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic BiFunction<sun.misc.Signal, Long, String[]> Hack to provide a signal sender.Fields inherited from class com.glitchybyte.glib.process.GOSInterface
instance, osType, SIGINT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]getShellCommand(String command) Returns a command array ready to call the shell with the given script.String[]getSignalCommand(sun.misc.Signal signal, long pid) Returns the command array that will send the given signal to the pid.Methods inherited from class com.glitchybyte.glib.process.GOSInterface
createProcessBuilder, execute, execute, execute, execute, executeWithResult, executeWithResult, isSuccessfulExitCode, makeCommand, sendSignal, sendSignalINT
-
Field Details
-
hackGetSignalCommand
Hack to provide a signal sender.windows-kill works perfectly for this.
Once placed somewhere in your system it can be specified like this:
GOSWindows.hackGetSignalCommand = (signal, pid) -> new String[] { "path/to/windows-kill.exe", "-SIG" + signal.getName(), pid.toString() };
-
-
Constructor Details
-
GOSWindows
public GOSWindows()Creates a Windows OS interface.
-
-
Method Details
-
getShellCommand
Description copied from class:GOSInterfaceReturns a command array ready to call the shell with the given script.- Specified by:
getShellCommandin classGOSInterface- Parameters:
command- Shell command with args.- Returns:
- A new command string.
-
getSignalCommand
Description copied from class:GOSInterfaceReturns the command array that will send the given signal to the pid.- Specified by:
getSignalCommandin classGOSInterface- Parameters:
signal- Signal to send.pid- Pid of process.- Returns:
- Command array.
-