Thread: Windows or Unix environment

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    26

    Windows or Unix environment

    I am using a function that determines the amount of free disk space available on any drive. My problem is that I first need to determine whether or not I am in a windows environment or a unix environment. From here, I will be able to call the particular fuctions that determine the disk space.

    Any suggestions.

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    You're programming under Windows or Unix, not both. So when compiling the program under Windows, it will not work under Unix.

  3. #3
    S­énior Member
    Join Date
    Jan 2002
    Posts
    982
    If you want to use the same source code, you can wrap the system specific functions in

    #ifdef WIN32
    //windows stuff
    #endif

    #ifdef UNIX
    //unix stuff
    #endif

    but as Shiro has pointed out, it'll need compiling in each enviroment.

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    26
    Are you able to call a unix function from a windows programming environment?

  5. #5
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Originally posted by ghe1
    Are you able to call a unix function from a windows programming environment?
    Only if it has been ported to the windows environment.

    If you want cross platform code, then Java is still your best option.

  6. #6
    Registered User
    Join Date
    Feb 2002
    Posts
    26
    PROBLEMS ALL RESOLVED...THANKS FOR SUGGESTIONS!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Connecting windows through Unix
    By vin_pll in forum Tech Board
    Replies: 10
    Last Post: 06-23-2008, 10:32 PM
  2. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  3. Menu Item Caption - /a for right aligned Accelerator?
    By JasonD in forum Windows Programming
    Replies: 6
    Last Post: 06-25-2003, 11:14 AM
  4. Codec Bitrates?
    By gvector1 in forum C# Programming
    Replies: 2
    Last Post: 06-16-2003, 08:39 AM
  5. How May I connect from Windows NT to Unix
    By jose luis in forum C Programming
    Replies: 3
    Last Post: 08-22-2002, 03:12 PM