public FileIO(String directory, String fi, boolean app){
        log = new Logger();
        s = System.getProperty("file.separator");
        
        File dir = new File(directory);
        if (!dir.exists()){
            dir.mkdirs();
        }
        
        // get the path to the file
        file = new File(directory + s, fi);
        
        try {
            if (!file.canWrite()){
                file.createNewFile();
            }
            
            reader = new BufferedReader(new FileReader(file));
            writer = new PrintWriter(new FileWriter(file, app));
        } catch (FileNotFoundException e){
            log.writeErr("Could not access file: " + file.getAbsolutePath() + "\nError was: " + e.getMessage());
        } catch (IOException ex) {
            log.writeErr("Could not read/write to file: " + file);
        }
        
        
    }