LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Use win32 sdk to rename an NTFS file

What's the best way to rename an existing, open, NTFS file using the Win32 SDK?

 

There's no RenameFile() function.

 

Surely there's some way the Win32 API will help do this other than simply closing, creating a new file with new name, and copying old file to new, then deleting old?

 

Menchar

0 Kudos
Message 1 of 3
(3,363 Views)

Check out MoveFile() in the SDK. I'm not sure it is legal to rename a file that is already open by another application at the time.

 

JR

0 Kudos
Message 2 of 3
(3,357 Views)

JR - I saw that function but thought that there might be some better way.  Surely this is done all the time.

 

No, I wouldn't expect to be able to rename an open file.

 

Menchar

0 Kudos
Message 3 of 3
(3,336 Views)