On 7/3/06, Alexandre Leclerc <[EMAIL PROTECTED]> wrote:
I search for a simple way to know under which OS i'm running?
Because some specific code should be executed under given OS

For most cases you could use:

{$ifdef win32}
 // Do windows specific stuff
{$endif}
{$ifdef Unix}
 // Do Unix stuff
{$endif}

- does the current os support drive letters (I made a hak for this)

Only windows works with drive letters. But don“t worry about it. If
you are dealing with drive letters directly your code is probably very
wrong.

- what directory structure I should adopt? (this one is a complete
different logic set)
  example: c:\app\images or /usr/local/images should be used?

I assume you are trying to store some data files for the application, right?

This is becoming a FAQ. Wait a few minutes and I will write a complete
solution for this on the Wiki.

Or, is there a unit I did not see where I can call a function to know
the information about the OS.

There are some cross-platform functions to retrive a suitable
directory for configuration files and things like that:

http://wiki.lazarus.freepascal.org/index.php/Multiplatform_Programming_Guide#On_Linux_there_is_no_.22application_directory.22

--
Felipe Monteiro de Carvalho

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to