FileUtil fileut= new FileUtil(); fileut.openInputFile();
@Provides @DefinitionDir File definitionDir(@WorkingDir File workingDir, OuterParsingOptions options) { if (options.directory == null) { // bootstrap the part of FileUtil we need return options.mainDefinitionFile(new FileUtil(null, null, workingDir, null, null, null)).getParentFile(); } File f = new File(options.directory); if (f.isAbsolute()) return f; return new File(workingDir, options.directory); }
@Provides @KompiledDir File kompiledDir(@DefinitionDir File defDir, OuterParsingOptions options, @WorkingDir File workingDir, @TempDir File tempDir) { // bootstrap the part of FileUtil we need return new File(defDir, FilenameUtils.removeExtension(options.mainDefinitionFile(new FileUtil(null, null, workingDir, null, null, null)).getName()) + "-kompiled"); } }
public static void nailMain(NGContext context) throws IOException { FileUtil files = new FileUtil(null,null,new File(context.getWorkingDirectory()),null,null,null); File f = files.resolveWorkingDirectory(context.getArgs()[0]); FileChannel channel = FileChannel.open(f.toPath()); ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size()); K result = BinaryParser.parse(buf); ToKast.apply(result, new PrintStream(new FileOutputStream(files.resolveWorkingDirectory(context.getArgs()[1])))); }
@Provides ProcessBuilder pb(@WorkingDir File workingDir, @Environment Map<String, String> env) { return new FileUtil(null, null, workingDir, null, null, env).getProcessBuilder(); }
public static FileUtil testFileUtil() { File workingDir = new File("."); return new FileUtil(workingDir, Providers.of(workingDir), workingDir, Providers.of(workingDir), new GlobalOptions(), System.getenv()); }
KExceptionManager kem = new KExceptionManager(globalOptions); FileUtil fileUtil = new FileUtil(theFileUtilTempDir, Providers.of(definitionDir), workingDir,