Code

Some useful code snippets

Working directory in c sharp

A function in c sharp  to get working directory the programm private string? GetWorkingdir() { string? tmpDir = “”; try { string tmpDir1 = AppContext.BaseDirectory; if (Directory.Exists(tmpDir1)) { Console.WriteLine(“dir exists read file ??”); tmpDir = tmpDir1; } } catch (Exception ex) { System.Console.WriteLine(ex); tmpDir = null; } return tmpDir; }

Working directory in c sharp Read More »

Bash unzip script

#!/bin/bash # script to decompress zips and copy used zips to dir # the important directories my_zip_dir=”/home/USER/zip_dir” my_pict_dir=”/home/USER/pict_dir” # the testing —————————————- # are there zip files ls *.zip > /dev/null 2>&1 if [ $? -eq 0 ]; then echo “zip files present, programm continues” else echo ERROR: no zip files found programm stops exit

Bash unzip script Read More »

Scroll to Top