PlanetSquires Forums

Support Forums => WinFBX - Windows Framework for FreeBASIC => Topic started by: SeaVipe on October 21, 2022, 11:37:11 PM

Title: cFileSys Questions
Post by: SeaVipe on October 21, 2022, 11:37:11 PM
Hi José, a couple of questions regarding CopyFolder and CreateFolder from the Help file:
DIM pFileSys AS CFileSys
DIM pFolder AS Afx_Folder PTR ' <-- This line throws compiler error 14 Expected Identifier - Afx_Folder
pFolder = pFileSys.CreateFolder("C:\MyNewFolder")
IF pFolder THEN
  ' ....
  pFolder.Release
END IF

Does CopyFolder require the destination folder to already exist or will CopyFolder create the destination folder?
Title: Re: cFileSys Questions
Post by: Paul Squires on October 21, 2022, 11:53:23 PM
Looks like a typo. Should be Afx_IFolder
Title: Re: cFileSys Questions
Post by: SeaVipe on October 22, 2022, 12:29:26 AM
Magic! Thanks, Paul.
Title: Re: cFileSys Questions
Post by: José Roca on October 22, 2022, 09:06:00 AM
> Does CopyFolder require the destination folder to already exist or will CopyFolder create the destination folder?

If the destination folder does not exist, it creates it. If it already exists, it throws an error or overwites it depending if you have passed False or True in the OverWriteFiles parameter.

I have expanded the documentation of CopyFolder:
https://github.com/JoseRoca/WinFBX/blob/master/docs/File%20Management/CFileSys%20Class.md#CopyFolder

I also have corrected the Afx_Folder PTR typo and expanded the documentation for the CopyFile method.
Title: Re: cFileSys Questions
Post by: SeaVipe on October 22, 2022, 02:04:34 PM
Much appreciated, José, thank you.