Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-06

Missing GetLastOSError() in DOS and MacOS

6 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Bihar Anwar

I don't see SysUtils.GetLastOSError() in DOS. Looking at a glance, I think it will be a trivial effort by just returning Dos.DosError variable content.

Also, I notice that SysUtils.GetLastOSError() in MacOS is defined but it's implementation is empty. I've no knowledge on MacOS, so my question is... Is this by designed?

Tomas Hajny
to Bihar Anwar
Bihar Anwar wrote
I don't see SysUtils.GetLastOSError() in DOS. Looking at a glance, I think it will be a trivial effort by just returning Dos.DosError variable content.

Thanks for the notification, I'll have a look at it (creating a bug report to make sure it isn't forgotten would be even better).

I'm not sure if taking DosError is sufficient though. I need to look up the specification in order to check whether the function is supposed to provide the last error result for SysUtils (or RTL in general), or whether it should return the last OS error for what OS function invoked recently (also directly without using RTL). If it's the latter (I believe that this is the case in Delphi and also existing FPC implementations for other platforms), it would be probably more appropriate to use the DOS API function providing this information.

Also, I notice that SysUtils.GetLastOSError() in MacOS is defined but it's implementation is empty. I've no knowledge on MacOS, so my question is... Is this by designed?

Sorry, I cannot answer this one.

Tomas

Bihar Anwar
to Tomas Hajny
Tomas Hajny wrote
... or whether it should return the last OS error for what OS function

invoked recently (also directly without using RTL).

Yes, I think this one is agreed with other similar RTL functions.

Jonas Maebe
to Bihar Anwar: I don't see SysUtils.GetLastOSError() in DOS. Looking at a glance, I think it will be a…
Bihar Anwar wrote
Also, I notice that SysUtils.GetLastOSError() in MacOS is defined but it's implementation is empty. I've no knowledge on MacOS, so my question is... Is this by designed?

"MacOS" in the RTL stands for "System 7.5 - Mac OS 9.2.x", i.e., the "classic Mac OS" which preceded Mac OS X. I don't think the sysutils unit was ever completely ported for that platform.

Jonas

Bihar Anwar
to Jonas Maebe

June

Jonas Maebe wrote
"MacOS" in the RTL stands for "System 7.5 - Mac OS 9.2.x", i.e., the "classic Mac OS" which

preceded Mac OS X. I don't think the sysutils unit was ever completely ported for that platform.

Thanks Jonas, your clarification strengthens my thought before. I saw other several defects in MacOS SysUtils, just mention the implementation of FindNext:

   Result:=DoFind (Rslt);  // whereas DoFind() is declared as a procedure

How can that be compiled?

I think, I will increase the requirement of my base units to at least the MacOS X.

Jonas Maebe
to Bihar Anwar
Bihar Anwar wrote 8 lines
Thanks Jonas, your clarification strengthens my thought before. I saw other several defects in MacOS SysUtils, just mention the implementation of FindNext: Result:=DoFind (Rslt); // whereas DoFind() is declared as a procedure How can that be compiled?

Maybe it was a function in the past.

I think, I will increase the requirement of my base units to at least the MacOS X.

That's definitely a good idea.

Jonas