File tree Expand file tree Collapse file tree 1 file changed +25
-4
lines changed Expand file tree Collapse file tree 1 file changed +25
-4
lines changed Original file line number Diff line number Diff line change @@ -92,10 +92,23 @@ object temp {
9292 * }
9393 * }}}
9494 */
95- def withFile [A ](fun : Path => A ): A =
95+ def withFile [A ](
96+ fun : Path => A ,
97+ contents : Source = null ,
98+ dir : Path = null ,
99+ prefix : String = null ,
100+ suffix : String = null ,
101+ perms : PermSet = null
102+ ): A = {
96103 Using .resource(os.temp(
97- deleteOnExit = false // TempFile.close() deletes it, no need to register with JVM
104+ contents = contents,
105+ dir = dir,
106+ prefix = prefix,
107+ suffix = suffix,
108+ deleteOnExit = false , // TempFile.close() deletes it, no need to register with JVM
109+ perms = perms
98110 ))(fun)
111+ }
99112
100113 /**
101114 * Convenience method that creates a temporary directory and automatically deletes it
@@ -108,9 +121,17 @@ object temp {
108121 * }
109122 * }}}
110123 */
111- def withDir [A ](fun : Path => A ): A =
124+ def withDir [A ](
125+ fun : Path => A ,
126+ dir : Path = null ,
127+ prefix : String = null ,
128+ perms : PermSet = null
129+ ): A =
112130 Using .resource(os.temp.dir(
113- deleteOnExit = false // TempFile.close() deletes it, no need to register with JVM
131+ dir = dir,
132+ prefix = prefix,
133+ deleteOnExit = false , // TempFile.close() deletes it, no need to register with JVM
134+ perms = perms
114135 ))(fun)
115136
116137}
You can’t perform that action at this time.
0 commit comments