>>How can I rename a directory from inside VFP6? I suppose is via the API but don't know how to do it.
>
>Try using rename() from the C++ runtime:
>
>Declare Integer rename in MSVCRT.dll As _rename String @oldname, String @newname
>md c:\foo
>lsOld = "c:\foo"
>lsNew = "c:\newfoo"
>_rename(@lsOld, @lsNew)
>
Actually, you could omit it and either prefix it with an = (forcing it to be treated as a function call) or use it as a numeric expression (success returns 0) so the following work:
Declare Integer rename in MSVCRT.dll As rename String @oldname, String @newname
=rename(lsOld,lsNew)
IF rename(lsOld,lsNew) = 0
ELSE
ENDIF
>Note that you have to alias the function name because VFP already has a RENAME command.