You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -17,24 +14,34 @@ fun linesFrom(vararg lines: String) = lines.asSequence()
17
14
* File argument processor that works similar to awk. If data is available on stdin, use it. If not expect a file argument and read from that one instead.
/** Save a list of items into a file. Output can be option ally zipped and a the stringifying operation can be changed from toString to custom operation if needed. */
51
-
fun <T> Iterable<T>.saveAs(f:File,
58
+
fun <T> Iterable<T>.saveAs(f:java.io.File,
52
59
transform: (T) ->String = { it.toString() },
53
60
separator:Char = '\n',
54
61
overwrite:Boolean = true,
@@ -57,7 +64,7 @@ fun <T> Iterable<T>.saveAs(f: File,
57
64
// ensure that file is not yet there or overwrite flag is set
58
65
require(!f.isFile || overwrite) { "$f is present already. Use overwrite=true to enforce file replacement." }
59
66
60
-
val p =if (!compress) PrintWriter(f) elseBufferedWriter(OutputStreamWriter(GZIPOutputStream(FileOutputStream(f))))
67
+
val p =if (!compress) java.io.PrintWriter(f) elsejava.io.BufferedWriter(java.io.OutputStreamWriter(java.util.zip.GZIPOutputStream(java.io.FileOutputStream(f))))
0 commit comments