Skip to content

How to Rename Files and Folders in C#: .NET 10 update and batch rename fix - #2355

Merged
vladimir-pecanac-main merged 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/101271-csharp-rename-files-in-a-folder
Nov 2, 2026
Merged

vladimir-pecanac-main merged 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/101271-csharp-rename-files-in-a-folder

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Retargets files-csharp/RenameFilesWithCSharp to net10.0 with current xUnit test packages, turns the library into a runnable console app with a Program.cs that calls the demos, fixes the batch image rename so two files with the same creation second no longer collide (the loop adds _1, _2 until the name is free, and a second run changes nothing), adds a FileInfo version of the batch method, a Directory.Move folder rename and a Path.ChangeExtension helper, and adds five tests covering the collision, the rerun, the folder rename, the extension change and the overwrite overload.

… and extension renames

Retarget to net10.0 and current xUnit packages, make the sample runnable with Program.cs, check the new name is free before each batch move, add Directory.Move and Path.ChangeExtension helpers, and add five tests.
@vladimir-pecanac-main
vladimir-pecanac-main merged commit 8e6930a into CodeMazeBlog:main Nov 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant