barry_sellew

Does Nucleus FILE support moving files?

Discussion created by barry_sellew on Aug 7, 2012

Symptoms

 

Nucleus FILE does not have an explicit API function to move a file.

 

 

Solution

 

Files can be moved using the NU_Rename() API function in Nucleus FILE.



NU_Rename() treats the combination of a file's name and full path as the file's "name."  If the new "name" for a file

has the same base file name, but a different path, the file will effectively be moved to the specified directory.


For example:


NU_Rename("\\dirA\\test\\file.txt", "\\dirB\\test1\\test2\\file.txt");


will move file.txt from the \dirA\test\ directory to the \dirB\test1\test2\ directory.



NOTE:  NU_Rename() can only move files to locations on the same storage device.



NU_Rename() supports moving files in versions 3.1 and higher of Nucleus FILE.

Outcomes