Is there any way to rename a file without having to create a new file and delete the old file? It seems like Filesystem should handle this, but I don't see a rename action is Filesystem.
Thanks
Hi Junfeng,
There is no explicit rename file command in .NET/C#, so that's why FileSystem lacks it. Unfortunately, the canonical way, using File_Move, doesn't work, as DestinationDirectoryPath cannot contain a file name. I'll see if I can add a File_Rename to FileSystem so renameing a file is possible.
EDIT: I didn't look right, and in fact you can use File_Move to rename a file. To do so, make sure DestinationDirectoryPath contains the same path as Path, and specify a different file name. I'll update the documentation to explicitly mention using File_Move for renaming a file.
i have a same question
Hi Kilian Hekhuis
Many Thanks , Now i get it.