Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename task deletes file if nothing to rename #13

Closed
pekkatki opened this issue Oct 15, 2019 · 1 comment · Fixed by #24
Closed

Rename task deletes file if nothing to rename #13

pekkatki opened this issue Oct 15, 2019 · 1 comment · Fixed by #24
Assignees
Labels

Comments

@pekkatki
Copy link

Frends.File.Rename (1.0.33)

If user defines the "New file name" e.g. #var.filename.Replace("ä", "ä").Replace("Õ¤", "Ö") and #var.filename does not contain characters that are to be replaced, the file in question is deleted.

What should happen is that if there is nothing to rename, the filename stays as it is and the file is not deleted.

@ttossavainen
Copy link
Contributor

This bug occurs when FileExistsAction.Overwrite and target file exists.

Changes in review:

  • An exception is thrown if input.NewFileName is empty or/and input.Path doesn't exists.
  • If target file already exists,
    • FileExistsAction.Overwrite will overwrite the target file and delete the original file if both the original and new files match in size. Throwing an exception if size doesn't match.
    • FileExistsAction.Rename will now append number to name given in Input.NewFileName.

@jefim jefim closed this as completed Jun 7, 2024
@jefim jefim linked a pull request Jun 7, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants