Main Site Documentation

File.Rename missing


#1

Actually my data logger performs a File.Copy to copy the current log file if greater than 2MB into log_Date_Time. It then delete the current file and creates a new empty one.

This process is particularly slow, especially the file copy.

Is there a way to just rename this file with netmf?


#2

Hi leforban,
You can use the Move() method, which will move the file to a new location provided an option to rename the file.

http://msdn.microsoft.com/en-us/library/ee433627.aspx

Jay


#3

Real Time answer :slight_smile: That is so cool!!! I hope it will take less time than File.Copy…


#4

This is really better:
FYI
FileCopy takes 100sec for 2MB on my EMX, while File.Move takes less than a second

Agains Really Tank You Jay


#5

File.Move only needs to modify the file allocation table


#6

You are welcome :wink: