How to copy a file so it creates missing folders in the path

tbodine lvhdgc7 at
Thu May 9 19:39:02 EDT 2013


I'm working on a Win/Mac application and trying to copy a Preferences stack
from the defaultFolder to Application Data with a unique folder there to
house it. I build a path, including the folder name, but revCopyFile
silently fails every time. If I remove the desired folder from the path, it
works but leaves my file loose in the top level App Data folder. Is there a
way to do this that creates any missing folders in the path?

My code is:

 if gOS contains "Mac" then
    put specialFolderPath("asup") into tPath
   put specialFolderPath(26) into tPath
end if
put tPath & "/MyFolder/Settings.rev" into gSettingsPath

put "CustomSettings.rev" into tSourceFile
revCopyFile tSourceFile, gSettingsPath

When I have the folder name in the path, this fails. If I remove it, it
works. (I'm also changing the name of the stack file during the copy
process, but don't think that matters.)

Tom Bodine

View this message in context:
Sent from the Revolution - User mailing list archive at

More information about the Use-livecode mailing list