Common code for Unix & NT 
Author Message
 Common code for Unix & NT


Quote:
>   We're in the process of putting our pure Tk applications on
> Network Appliance boxes with CIFS so that they may be native
> mounted from both Unix and NT systems.  I'd like to run the
> same programs in both environments; without the MSDOS window
> behind the NT runs.

Let me make sure I understand what you want, first. Correct me wherever I
wander:

1)  You have scripts sitting on the Filer, visible to both Unix and NT.
2a) Under Unix, you want to take advantage of the shebang magic to be able
    to 'just run' your scripts.
2b) Under NT, you want to take advantage of the Explorer's extension
    mapping to be able to 'just run' your scripts by double-clicking on
    them
3)  Under NT, you don't want the annoying console window flashing up.

Have I got all of this correct? If so, grab this tarball:

ftp://ftp.perspex.com/pub/noflash/noflash-1.0.tar.gz
ftp://ftp.perspex.com/pub/noflash/noflash-1.0.zip (if you prefer)

It contains a really trivial program called 'noflash' that does the same
as the 15.17 recipe in the Ram. However, it doesn't require any Perl code,
which, in your case turns out to be a benefit.

Associate your extension (.ple, you suggested) with 'noflash perl "%1" %*'
(assuming noflash and perl are in your path -- you might be better off
giving them fully-qaulified names, though).

If I've understood you correctly, this will do what you want it to do. The
same sources will run under both Unix and NT, unmodified. Under NT, due to
the noflash invocation, they'll not display the console window.

--

------------------------------------------------------------------------------
"Some people only attach value to things they have to pay for. This is the
businessman's mindset. He believes in Money, with a capital M. It defines him,
and his relationship with the world is interpreted in terms of the flow of
cash. This is the work of Adam Smith's Invisible Hand, which has long been
wedged up Adam Smith's Invisible Butt."

   Jeremy Lee, in http://www.*-*-*.com/

==========================================================================
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Mon, 09 Jul 2001 03:00:00 GMT  
 Common code for Unix & NT
        > For what it is worth (?): when the subject of recommended
extensions
        > came up on p5p not too long ago Tom Christiansen expressed his
disdain
        > for .pl since that was used for perl 4 package libraries.  He
went on
        > to recommend .plx for systems that need extensions (such as
NT) and I
        > have since seen a few scripts named with the .plx extension
(examples

        May I please argue against using something other than .pl on NT
and related boxes, if only because .pl has become a defacto standard.
It doesn't really affect me all that much since I wouldn't change over
(if you had a thousand separate scripts written based around .pl you
wouldn't either:).  Anyone still using perl 4 deserves to be confused:).

        --Toby Everett
==========================================================================
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the



Tue, 10 Jul 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. ? 5 Most Common Unix>NT Translation Problems ?

2. Help - Porting code from UNIX to NT

3. UNIX to NT - two lines of code

4. Help - Porting code from UNIX to NT

5. ANNOUNCE: Net::LDAPapi v1.40 (Unix & NT)

6. ANNOUNCE: Net::LDAPapi v1.39a (Unix & NT)

7. strange Perl incompatibility (NT & UNIX)

8. including common code between CGI scripts

9. Including common code as text in many scripts

10. Including common code with 'my' variables

11. Memory leak in Perl4 - common CGI code.

12. Getting access to common error codes across objects?

 

 
Powered by phpBB® Forum Software