Skip to content

Instantly share code, notes, and snippets.

@petesh
Created April 13, 2018 10:43
Show Gist options
  • Save petesh/b7394ae6038f4cdaaf9e5fbe0425f453 to your computer and use it in GitHub Desktop.
Save petesh/b7394ae6038f4cdaaf9e5fbe0425f453 to your computer and use it in GitHub Desktop.
using ls on the files to ensure that they're present.
using System;
using System.Diagnostics;
public class simpletest
{
static public void Main ()
{
Console.WriteLine(">>> use ls on the binary <<<");
var psi = new ProcessStartInfo("/bin/ls", "-l /usr/bin/7z");
var proc = new Process() { StartInfo = psi, };
proc.Start();
proc.WaitForExit();
Console.WriteLine(">>> use ls on a missing file <<<");
psi = new ProcessStartInfo("/bin/ls", "-l /usr/bin/7zzz");
proc = new Process() { StartInfo = psi, };
proc.Start();
proc.WaitForExit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment