diff --git a/nethack-launcher/create_initial_files.go b/nethack-launcher/create_initial_files.go index c352d1e..1d9a41b 100644 --- a/nethack-launcher/create_initial_files.go +++ b/nethack-launcher/create_initial_files.go @@ -11,18 +11,12 @@ func createInitialFiles() { if _, err := os.Stat(config.NethackLauncher.HackDir); os.IsNotExist(err) { os.Mkdir(config.NethackLauncher.HackDir, os.ModeDir) } - if _, err := os.Stat(fmt.Sprintf("%s/dumps/", config.NethackLauncher.HackDir)); os.IsNotExist(err) { - os.Mkdir(fmt.Sprintf("%s/dumps/", config.NethackLauncher.HackDir), os.ModeDir) - } - if _, err := os.Stat(fmt.Sprintf("%s/save/", config.NethackLauncher.HackDir)); os.IsNotExist(err) { - os.Mkdir(fmt.Sprintf("%s/save/", config.NethackLauncher.HackDir), os.ModeDir) - } - - // create necessary files if they dont exist - os.OpenFile(fmt.Sprintf("%s/logfile", config.NethackLauncher.HackDir), os.O_RDONLY|os.O_CREATE, 0666) - os.OpenFile(fmt.Sprintf("%s/perm", config.NethackLauncher.HackDir), os.O_RDONLY|os.O_CREATE, 0666) - os.OpenFile(fmt.Sprintf("%s/record", config.NethackLauncher.HackDir), os.O_RDONLY|os.O_CREATE, 0666) - os.OpenFile(fmt.Sprintf("%s/xlogfile", config.NethackLauncher.HackDir), os.O_RDONLY|os.O_CREATE, 0666) + //if _, err := os.Stat(fmt.Sprintf("%s/dumps/", config.NethackLauncher.HackDir)); os.IsNotExist(err) { + // os.Mkdir(fmt.Sprintf("%s/dumps/", config.NethackLauncher.HackDir), os.ModeDir) + //} + //if _, err := os.Stat(fmt.Sprintf("%s/save/", config.NethackLauncher.HackDir)); os.IsNotExist(err) { + // os.Mkdir(fmt.Sprintf("%s/save/", config.NethackLauncher.HackDir), os.ModeDir) + //} // move in nhdat file if it does not exist if _, err := os.Stat(fmt.Sprintf("%s/nhdat", config.NethackLauncher.HackDir)); os.IsNotExist(err) { diff --git a/nethack-launcher/create_user_files.go b/nethack-launcher/create_user_files.go index c50c02d..c0920b6 100644 --- a/nethack-launcher/create_user_files.go +++ b/nethack-launcher/create_user_files.go @@ -24,5 +24,5 @@ func createUserFiles(username string) { os.OpenFile(fmt.Sprintf("%s/xlogfile", userpath), os.O_RDONLY|os.O_CREATE, 0666) // move in nhdat file if it does not exist - exec.Command("cp", config.NethackLauncher.NhdatLocation, userpath).Run() + exec.Command("cp", fmt.Sprintf("%s/nhdat", config.NethackLauncher.HackDir), userpath).Run() }