Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: How to find out if it is 32bit or 64bit windows?

by davido (Cardinal)
on Jun 22, 2011 at 16:10 UTC ( [id://910928]=note: print w/replies, xml ) Need Help??


in reply to Re^2: How to find out if it is 32bit or 64bit windows?
in thread How to find out if it is 32bit or 64bit windows?

Are you sure? It seems to me it's reporting the CPU bitness, not the OS bitness. When I run your original test it still reports bitness as '0'.

I may be wrong but I don't believe it's safe to assume that CPU bitness == OS bitness.


Dave

Replies are listed 'Best First'.
Re^4: How to find out if it is 32bit or 64bit windows?
by BrowserUk (Patriarch) on Jun 22, 2011 at 16:31 UTC
    I don't believe it's safe to assume that CPU bitness == OS bitness.

    You cannot run a 64-bit build of an OS on a 32-bit processor.

    You can run a 32-bit build of an OS on an (intel) 64-bit processor, but that is done by running the CPU in 32-bit compatibility mode, when for all intents and purposes, it is a 32-bit processor. So, whilst it may be possible to distinguish between the two scenarios, there is little benefit in doing so as none of the 64-bit facilities would be available to you.

    Leastwise, none that I can think of.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      So the module returns 32-bit for a 64-bit CPU running a 32-bit OS?
        So the module

        Which module?

        Assuming you mean Sys::Info, (Not that I would use that suite of modules anyway.), I have no idea, but it should.

        Specifically, the code that deals with 'bitness' queries is Sys::Info::Base which is the base class for Sys::Info::OS. So the question being asked in your scenario above is the bitness of the OS, which should be 32-bit regardless of whether it is running on a 32-bit or 64-bit cpu. And if that is not what the module returns, it is wrong(ly specified).

        The answer to what the OP really needs to know will always come back to why he needs to know it. With all the possibilities we have these days:

        • 32-bit Perl running under a 32-bit OS on a 32-bit processor.
        • 32-bit Perl running under a 32-bit OS on a 64-bit processor
        • 32-bit Perl running under a 64-bit OS on a 64-bit processor
        • 64-bit Perl running under a 64-bit OS on a 64-bit processor
        • 32-bit Perl running under a 32-bit OS within a VM emulating a 32-bit processor, guesting on a 32-bit OS running on a 32-bit processor.
        • 32-bit Perl running under a 32-bit OS within a VM emulating a 32-bit processor, guesting on a 32-bit OS running on a 64-bit processor.
        • 32-bit Perl running under a 32-bit OS within a VM emulating a 32-bit processor, guesting on a 64-bit OS running on a 64-bit processor.
        • 32-bit Perl running under a 32-bit OS within a VM emulating a 64-bit processor, guesting on a 64-bit OS running on a 64-bit processor.
        • 32-bit Perl running under a 64-bit OS within a VM emulating a 64-bit processor, guesting on a 64-bit OS running on a 64-bit processor.
        • 64-bit Perl running under a 64-bit OS within a VM emulating a 64-bit processor, guesting on a 64-bit OS running on a 64-bit processor.
        • Other?

        working out which piece of information is actually relevant to the OPs purpose is impossible until he states that purpose.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
Re^4: How to find out if it is 32bit or 64bit windows?
by Burak (Chaplain) on Jun 24, 2011 at 11:36 UTC
    Hi davido,

    A couple of questions:

    • What's your Sys::Info::Driver::Windows::OS and Sys::Info and perl versions?
    • ActivePerl, Strawbery or your own build of perl?
    • What's your Windows version (XP, Vista, 7, etc)?
    • How did you install Sys::Info::Driver::Windows? (ppm, gcc, cl)?
    Thanks,
    Burak

      • $Sys::Info::VERSION is 0.78
      • $Sys::Info::Driver::VERSION is 0.78.
      • perl -v => This is perl 5, version 12, subversion 2 (v5.12.2) built for MSWin32-x64-multi-thread.
      • Strawberry
      • Vista Home Premium 64 bit, service pack 2. Version 6.0.6002.
      • cpanm was my installation tool.
      • I verified Sys::Info::Driver::Windows is also 0.78.

      Strawberry Perl includes a 'gcc' C compiler with it so that modules can be installed through traditional means rather than relying on ppm packages. cpanm would have invoked the gcc compiler.


      Dave

        Thanks, I'll take a look when I have the time.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://910928]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (8)
As of 2024-03-28 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found