indigo. core. platform

Created08.08.2005
Last modified09.08.2005

This is an internal module of Indigo.  You can use it if you like, but be aware that it may be changed or even be removed in future versions.

Provides simple access to Platform specialties.  Compile with version “Indigo_WithoutStdlib” to remove its entire contents.

Summary
This struct simplifies handling the different platforms supported by the different D compilers.

Platform

This struct simplifies handling the different platforms supported by the different D compilers.  The platform specific D module (like std.c.linux.linux) is automatically included into this struct.  The following example shows how to retrieve file attributes using Platform under Linux/Unix:

Platform.struct_stat st;
Platform.lstat("test.txt", &st);
printf("Size of test.txt: %u\n", st.st_size);

If you want to test for a Unix system, you should always do it the following way.

// At the beginning of your module.
version (linux) version = Unix;

// Later.
version (Unix)
{
// Unix specific code here...
}
This struct simplifies handling the different platforms supported by the different D compilers.