file.move <- function(from, to, recursive=isdir(from)) {
  if (any(file.exists(to)))
    stop("Destination exists. Cannot overwrite with file.move() function, since it depends on the files `to` not existing\n\nDesitnation is\n\t", pasteC(to[file.exists(to)], "\n\t"))

  if (!(all(!recursive) || all(recursive)))
    warning("There are mixed T/F values for 'recursive' in file.move()  -- this was never tested and may have strange results")

  ## Create directory if not exist
  for (d in unique(dirname(to)))
    if (!file.exists(d))
      dir.create(d, recursive=TRUE)

  # ## tryCatch does not pass along the ret_rename var
  # any_failed <- tryCatch(
  #                 expr = {ret_rename <<- file.rename(from=from, to=to)}, 
  #                 warning=function(w) { if (grepl("Invalid cross-device link", w$message)) return(TRUE) else {warning(w); return(FALSE)}}, 
  #                 finally={FALSE}
  #               )

  ret_rename <- suppressWarnings(file.rename(from, to))

  for (i in which(!ret_rename)) {
      f <- from[i]
      t <- to[i]
      r <- recursive[i]

      file.copy(from=f, to=t, overwrite=FALSE, copy.date=TRUE, recursive=r)

      if (file.exists(t))
        tryCatch(unlink(f), error=function(e) {warning("Was unable to remove file '", f, "' -- error from unlink() is: \n", e)})
  }


  confirmed.removed <- !file.exists(from)
  confirmed.present <- file.exists(to)


  return(confirmed.removed & confirmed.present)
}