Small improvements to I/O

This commit is contained in:
Mark Harrah 2009-08-31 10:41:43 -04:00
parent 26da622276
commit 5fa328551c
3 changed files with 3 additions and 2 deletions

View File

@ -58,7 +58,7 @@ object NothingFilter extends NameFilter
object GlobFilter
{
def apply(expression: String): NameFilter =
implicit def apply(expression: String): NameFilter =
{
require(!expression.exists(java.lang.Character.isISOControl), "Control characters not allowed in filter expression.")
if(expression == "*")

View File

@ -43,7 +43,7 @@ trait OpenFile[T] extends OpenResource[File, T]
val parent = file.getParentFile
if(parent != null)
FileUtilities.createDirectory(parent)
translate("Error opening " + file + ": ") { openImpl(file) }
openImpl(file)
}
}
object OpenResource

View File

@ -4,6 +4,7 @@ import java.io.File
object Paths
{
implicit def stringToPath(s: String): Path = new Path(new File(s))
implicit def fileToPath(f: File): Path = new Path(f)
implicit def pathToFile(p: Path): File = p.asFile
implicit def filesToPaths(fs: Set[File]): Paths = new Paths(fs)