Initial add of defaria.com
[clearscm.git] / defaria.com / blogs / Status / archives / 000484.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml" id="sixapart-standard">
4 <head>
5    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6    <meta name="generator" content="Movable Type 5.2.3" />
7
8    <link rel="stylesheet" href="http://defaria.com/blogs/Status/styles-site.css" type="text/css" />
9    <link rel="alternate" type="application/atom+xml" title="Atom" href="http://defaria.com/blogs/Status/atom.xml" />
10    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://defaria.com/blogs/Status/index.xml" />
11
12    <title>Status for Andrew DeFaria: Forking in PerlTk</title>
13
14    <link rel="start" href="http://defaria.com/blogs/Status/" title="Home" />
15    <link rel="prev" href="http://defaria.com/blogs/Status/archives/000483.html" title="Remaining PQA Issues/GNATS stripmime" />
16    <link rel="next" href="http://defaria.com/blogs/Status/archives/000485.html" title="bin_merge/create_snapshot_view/PQA" />
17
18    
19
20    
21
22    <script type="text/javascript" src="http://defaria.com/blogs/Status/mt-site.js"></script>
23 </head>
24 <body class="layout-one-column" onload="individualArchivesOnLoad(commenter_name)">
25    <div id="container">
26       <div id="container-inner" class="pkg">
27
28          <div id="banner">
29             <div id="banner-inner" class="pkg">
30                <h1 id="banner-header"><a href="http://defaria.com/blogs/Status/" accesskey="1">Status for Andrew DeFaria</a></h1>
31                <h2 id="banner-description">Searchable status reports and work log</h2>
32             </div>
33          </div>
34
35          <div id="pagebody">
36             <div id="pagebody-inner" class="pkg">
37                <div id="alpha">
38                   <div id="alpha-inner" class="pkg">
39
40                      <p class="content-nav">
41                         <a href="http://defaria.com/blogs/Status/archives/000483.html">&laquo; Remaining PQA Issues/GNATS stripmime</a> |
42                         <a href="http://defaria.com/blogs/Status/">Main</a>
43                         | <a href="http://defaria.com/blogs/Status/archives/000485.html">bin_merge/create_snapshot_view/PQA &raquo;</a>
44                      </p>
45
46                      <a id="a000484"></a>
47                      <div class="entry" id="entry-484">
48                         <h3 class="entry-header">Forking in PerlTk</h3>
49                         <div class="entry-content">
50                            <div class="entry-body">
51                               <ul>
52   <li>Continued to help several users with connecting to the new Controller Clearquest Database for Vinh's users</li>
53
54   <li>Added Version Tree button to the bin_merge prompt dialog box.</li>
55
56   <li>Resolved problem with forking from PerlTk</li>
57 </ul>
58                            </div>
59                            <div id="more" class="entry-more">
60                               <h2>Forking in PerlTk</h2>
61
62 <p>The issue here is that calling fork(2) in general on Windows just doesn't work well. Clearcase's Perl is based on ActiveState Perl and ActiveState Perl is not the best implementation of Perl. Cygwin's Perl is by far a much better implementation but Cygwin's Perl works from a true Posix environment which is specifically what Cygwin is all about. However Cygwin's Perl does not support PerlTk (I posted on Cygwin's mailing list about this - it would be great if Cygwin would finally support PerlTk) and Cygwin would need to be present on all Windows systems.</p>
63
64 <p>In general, while fork(2) does work under ActiveState is does not work if you have Tk objects created. Chris had suggested to use "start &lt;program&gt;" which is fine - for Windows - but would fail in Unix. I like to wrote my code such that it works on both Windows and Unix. So I tried in vain to get fork to work. However, ActiveState's fork(2) call is horribly broken so I had to code around it like this:</p>
65
66 <div class="code"><pre>
67 sub VersionTree {
68   my $file = shift;
69
70   my $cmd =  "cleartool lsvtree -graphical $file";
71
72   if ($^O =~ /mswin|cygwin/i) {
73     system "start /b $cmd";
74   } else {
75     my $pid = fork;
76
77     return if $pid;
78
79     system $cmd;
80     exit;
81   } # if
82 } # VersionTree
83 </pre></div>
84                            </div>
85                         </div>
86                         <p class="entry-footer">
87                            <span class="post-footers">Posted by  on November 23, 2005  1:59 PM</span> <span class="separator">|</span> <a class="permalink" href="http://defaria.com/blogs/Status/archives/000484.html">Permalink</a>
88                         </p>
89                      </div>
90
91                      
92
93                      
94                   </div>
95                </div>
96             </div>
97          </div>
98       </div>
99    </div>
100 </body>
101 </html>