Used a StreamReader to read pacman.conf and then read one line until a line contains CacheDir Then used a regex to only get the cache directory