<commit_before>package java.io

import java.net.URI
import java.nio.file.Path
import lang.meta.internal.io._

// obtained implementation by experimentation on the JDK.
class File(path: String) {
  def this(parent: String, child: String) =
    this(parent + File.separator + child)
  def this(parent: File, child: String) =
    this(parent.getPath, child)
  def this(uri: URI) =
    this(
      if (uri.getScheme != "file") {
        throw new IllegalArgumentException("URI scheme is not \"file\"")
      } else {
        uri.getPath
      }
    )
  def toPath: Path =
    NodeNIOPath(path)
  def toURI: URI = {
    val file = getAbsoluteFile.toString
    val path =
      if (isDirectory && !file.endsWith("/")) file + "/"
      else file
    new URI("file", null, path, null)
  }
  def getAbsoluteFile: File =
    toPath.toAbsolutePath.toFile
  def getAbsolutePath: String =
    getAbsoluteFile.toString
  def getPath: String =
    path
  def exists(): Boolean =
    JSIO.exists(path)
  def isFile: Boolean =
    JSIO.isFile(path)
  def isDirectory: Boolean =
    JSIO.isDirectory(path)
  override def toString: String =
    path
}

object File {
  def listRoots() = 
    if (JSIO.isNode) List(JSIO.path.parse(JSIO.path.resolve()).root)
    else List(new File("/"))

  def separatorChar: Char =
    separator.charAt(0)

  def separator: String =
    if (JSIO.isNode) JSIO.path.sep
    else "/"

  def pathSeparator: String =
    if (JSIO.isNode) JSIO.path.delimiter
    else ":"
}<commit_msg>Make File.listRoot() return Array[File].<commit_after>package java.io

import java.net.URI
import java.nio.file.Path
import lang.meta.internal.io._

// obtained implementation by experimentation on the JDK.
class File(path: String) {
  def this(parent: String, child: String) =
    this(parent + File.separator + child)
  def this(parent: File, child: String) =
    this(parent.getPath, child)
  def this(uri: URI) =
    this(
      if (uri.getScheme != "file") {
        throw new IllegalArgumentException("URI scheme is not \"file\"")
      } else {
        uri.getPath
      }
    )
  def toPath: Path =
    NodeNIOPath(path)
  def toURI: URI = {
    val file = getAbsoluteFile.toString
    val path =
      if (isDirectory && !file.endsWith("/")) file + "/"
      else file
    new URI("file", null, path, null)
  }
  def getAbsoluteFile: File =
    toPath.toAbsolutePath.toFile
  def getAbsolutePath: String =
    getAbsoluteFile.toString
  def getPath: String =
    path
  def exists(): Boolean =
    JSIO.exists(path)
  def isFile: Boolean =
    JSIO.isFile(path)
  def isDirectory: Boolean =
    JSIO.isDirectory(path)
  override def toString: String =
    path
}

object File {
  def listRoots(): Array[File] = Array(
    new File(
      if (JSIO.isNode) JSIO.path.parse(JSIO.path.resolve()).root
      else "/"
    )
  )

  def separatorChar: Char =
    separator.charAt(0)

  def separator: String =
    if (JSIO.isNode) JSIO.path.sep
    else "/"

  def pathSeparator: String =
    if (JSIO.isNode) JSIO.path.delimiter
    else ":"
}
{'fraction_non_alphanumeric': 0.12080315997366689, 'fraction_numerical': 0.0006583278472679394, 'mean_word_length': 2.827455919395466, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4256873', 'n_tokens_mistral': 1036, 'n_tokens_neox': 1019, 'n_words': 263}