Recent

Author Topic: do_isdevice () and others  (Read 2303 times)

joho

  • Jr. Member
  • **
  • Posts: 69
  • Joaquim Homrighausen
    • ~/JoHo
do_isdevice () and others
« on: September 03, 2017, 08:20:01 am »
Do these actually exist?

http://wiki.freepascal.org/System_unit_structure#General_tasks

(In particular, do_isdevice)

Doing a grep -ir isdevice in the RTL sources would suggest that it does exist, but ...

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: do_isdevice () and others
« Reply #1 on: September 03, 2017, 08:39:47 am »
Yes, they do exist so also do_isdevice.

As the java version states (jsystem.inc):
Quote
{ for some OSes do_isdevice is defined in sysos.inc, but for others (win32) it isn't, and is used before the actual definition is encountered         }
Doing a grep will show you that the actual implementations are scattered around (depending on platform as stated in wiki). Usually you should be able to find the implementation inside sysfile.inc


joho

  • Jr. Member
  • **
  • Posts: 69
  • Joaquim Homrighausen
    • ~/JoHo
Re: do_isdevice () and others
« Reply #2 on: September 03, 2017, 11:42:11 am »
Excellent. So, "USES ..." what unit will give them to me? sysutils?

molly

  • Hero Member
  • *****
  • Posts: 2330
Re: do_isdevice () and others
« Reply #3 on: September 03, 2017, 11:59:35 am »
Ah sorry, i misunderstood you.

I thought you wanted to have a look at how things are implemented for certain platforms.

They are for internal use, e.g. when you want to extend the RTL. In which case you include the correct includefile (as can be seen in system.inc).
« Last Edit: September 03, 2017, 12:03:43 pm by molly »

joho

  • Jr. Member
  • **
  • Posts: 69
  • Joaquim Homrighausen
    • ~/JoHo
Re: do_isdevice () and others
« Reply #4 on: September 04, 2017, 08:48:08 am »
OK ... but why can't this interface be published?

It's quite a useful function to figure out if a file / handle belongs to an actual file or if it's a device of some sort ... FileIsDevice (const fh: THandle) or FileNameIsDevice (const fn: somecoolansipcharstringtypeprobably)?

 

TinyPortal © 2005-2018