Hi all,

The fileattr function has a different behaviour between HB and CLIPPER when
querying a directory. If directory exist, in CLIPPER the function returns 16
and HB returns 0. When running following prg twice in HB it gives a create
error while in CLIPPER works OK.

FUNCTION Main
LOCAL cDefa := set( _SET_DEFAULT )
IF ChkPastas( cDefa )
   alert( "OK" )
ENDIF
RETURN ( NIL )

STATIC FUNCTION ChkPastas( cDefa )
LOCAL lRetu := .t.
IF fileAttr( cDefa + "OUT" ) != 16  // DIRECTORY !EXIST
   IF dirMake( cDefa + "OUT" ) != 0     // CREATE
      alert( "PROBLEM CREATING " + cDefa + "OUT!" )
      lRetu := .f.
   ENDIF
ENDIF
IF lRetu .AND. fileAttr( cDefa + "IN" ) != 16
   IF dirMake( cDefa + "IN" ) != 0
      alert( "PROBLEM CREATING " + cDefa + "IN!" )
      lRetu := .f.
   ENDIF
ENDIF
RETURN ( lRetu )

Regards,
Vitor
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to