> On Fri, 2003-11-07 at 12:55, David Butler wrote: > > Sorry, I should have guessed. Yes, it basically takes the OS error and > > raises some exception. The exception message is the OS error message > > as returned by an OS function call. > > Here's a basic implementation that works for me (*): > > const > StrOSError : string = 'System error (number %d).'+LineEnding+'%s'; > > type > EOSError = class(Exception) > end; > > procedure RaiseLastOSError; > var > LError: integer; > begin > LError := GetLastError; > raise EOSError.CreateFmt(StrOSError,[LError,StrError(LError)]); > end; > > (*) for linux, GetLastError is not defined in system.pp. It should be > (to be Delphi compatible), and this works: > > function GetLastError: Integer; > begin > Result := fpGetErrno; > end;
I will look into this tomorrow. _______________________________________________ fpc-devel maillist - [EMAIL PROTECTED] http://lists.freepascal.org/mailman/listinfo/fpc-devel