renameSync static method

void renameSync(
  1. String oldPath,
  2. String newPath
)

Renames the file from oldPath to newPath. Allow path type of FileDirectoryLink.

Implementation

static void renameSync(String oldPath, String newPath) {
  if (isFileSync(oldPath)) {
    File(oldPath).renameSync(newPath);
  } else if (isDirectorySync(oldPath)) {
    Directory(oldPath).renameSync(newPath);
  } else if (isLinkSync(oldPath)) {
    Link(oldPath).renameSync(newPath);
  }
}