Hi,

I use the excellent cFilesystemclass from Allan Kim Eriksen to some file copying etc to do attachments in our app and and just came across this. It may have been resolved already but just in case it hasn't there is a missing parameter in the call to show an error when removing a directory.

Regards
Richard

Code:
    Function DirectoryRemove String sDirectoryName Returns Boolean
        String sDirectorynameANSI
        Boolean bFound bOk
        Integer iErrorNumber
        Move False to bOk
        Set pbError to False
        Get FileExists sDirectoryName DIRMODE_DIRECTORIES_ONLY to bFound
        If bFound Begin
            Move (toAnsi(sDirectoryName)) to sDirectorynameANSI
            Move (sDirectorynameANSI+(Character(0))) to sDirectorynameANSI
            Move (fsRemoveDirectory(AddressOf(sDirectorynameANSI))) to bOk
            If (bOk = False) Begin           // Could not delete
                Move (fsGetLastError()) to iErrorNumber
                If iErrorNumber Send DoShowError iErrorNumber ("Tried to remove directory: "+sDirectoryName)
            End
        End
        Function_Return bOk
    End_Function

    Procedure DoShowError Integer iErrorNumber String sAppendErrorText
        Pointer lpOut lpOutText
        Integer iRetChars iRetVal iMaxFiles
        String sMsg sFilename
        Boolean bOk
        Move 0 to lpOut
        Move (fsFormatMessage((FORMAT_MESSAGE_FROM_SYSTEM+FORMAT_MESSAGE_IGNORE_INSERTS+FORMAT_MESSAGE_ALLOCATE_BUFFER), FNULL, iErrorNumber, FNULL, AddressOf(lpOut), 0, FNULL)) to iRetChars
        If (iRetChars > 0) Begin
            ZeroString iRetChars to sMsg
            Move (MemCopy(AddressOf(sMsg), lpOut, iRetChars)) to bOk
            Move (fsLocalFree(lpOut)) to iRetVal
            Move (ToOEM(sMsg)) to sMsg
            If (num_arguments > 0) Begin
                Move (Trim(sAppendErrorText)) to sAppendErrorText
                If (sAppendErrorText <> "") Begin
                    Append sMsg "\n" sAppendErrorText
                End
            End
            Send warning_box sMsg
        End
    End_Procedure