Skip to content

Do not rename or move symlinks #36

@weierophinney

Description

@weierophinney

Bug Report

Q A
Version(s) 1.0.2 (current)

Summary

When running the migration tool, it runs a rename() operation on every file and directory, even if it is not being changed. Normally, this doesn't cause an error, but when encountering symlinks, the following can happen:

  • On Linux systems, you will receive warnings. For directories, these become PHP Warning: rename(..., ...): Directory not empty. For files, they are PHP Warning: rename(..., ...): Not a directory.

  • On Windows systems, they can be deleted entirely; see the forum post that originated this report.

Current behavior

Errors from attempts to rename symlinks on Linux, file/directory removal on Windows.

How to reproduce

Please see my comment on the forum post for instructions.

Expected behavior

No warnings, and no filename changes.

In the forum post that originated this report, neither filename was actually changing. I'd argue:

  • We should check for a change in name, and skip the rename() operation if no change occurs.
  • We should never descend into a symlinked directory.
  • We should skip symlinks on Windows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingHelp WantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions