<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
p
        {mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=ZH-CN link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'>Hi Charley,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'>You gave a convenient way
to achieve the goal. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'>By the way, I guess a
double quote is missing before the last bracket in the second line when using
expand_path().<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'>Thanks very much for your
help.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'>Jason<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 color=navy face=Arial><span lang=EN-US
style='font-size:9.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
wtr-general-bounces@rubyforge.org [mailto:wtr-general-bounces@rubyforge.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Charley Baker<br>
<b><span style='font-weight:bold'>Sent:</span></b> 2007</span></font><font
size=2 face=&#23435;&#20307;><span style='font-size:10.0pt;font-family:SimSun'>Äê</span></font><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>3</span></font><font
size=2 face=&#23435;&#20307;><span style='font-size:10.0pt;font-family:SimSun'>ÔÂ</span></font><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>6</span></font><font
size=2 face=&#23435;&#20307;><span style='font-size:10.0pt;font-family:SimSun'>ÈÕ</span></font><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
0:08<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">wtr-general@rubyforge.org</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Wtr-general] What is
the funtion in Ruby equivalent as strrchrin C</span></font><span lang=EN-US><o:p></o:p></span></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>There are
quite a few ways to do this, here's one using expand_path: <br>
<br>
f = </span></font><font size=1 face=Arial><span lang=EN-US style='font-size:
9.0pt;font-family:Arial'>File.dirname(__FILE__)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# get your test directory <br>
puts
File.expand_path(&quot;#{f}/..)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
# get the directory above your test directory <br>
<br>
-Charley </span></font><span lang=EN-US><o:p></o:p></span></p>

<div>

<p class=MsoNormal><span class=gmailquote><font size=3 face="Times New Roman"><span
lang=EN-US style='font-size:12.0pt'>On 3/5/07, <b><span style='font-weight:
bold'>Jason He</span></b> &lt; <a href="mailto:Jason.He@resilience.com">Jason.He@resilience.com</a>&gt;
wrote:</span></font></span><span lang=EN-US><o:p></o:p></span></p>

<div link=blue vlink=purple>

<div>

<p><font size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:
Arial'>Dear all,</span></font><span lang=EN-US><o:p></o:p></span></p>

<p><font size=3 face=Arial><span lang=EN-US style='font-size:12.0pt;font-family:
Arial'>&nbsp;</span></font><span lang=EN-US><o:p></o:p></span></p>

<p><font size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:
Arial'>I use &quot;example_logger1.rb&quot; and &quot;test_logger1.rb&quot;
C:\watir1145\examples\logging to logging, but a problem is that the generated
log file will under the same directory with test cases, </span></font><span
lang=EN-US><o:p></o:p></span></p>

<p><font size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:
Arial'>I want put the generated logs into a separated directory.</span></font><span
lang=EN-US><o:p></o:p></span></p>

<p><font size=3 face=Arial><span lang=EN-US style='font-size:12.0pt;font-family:
Arial'>&nbsp;</span></font><span lang=EN-US><o:p></o:p></span></p>

<p><font size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:
Arial'>The code in the &quot;example_logger1.rb&quot; is that,</span></font><span
lang=EN-US><o:p></o:p></span></p>

<p><font size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:
Arial'>&nbsp;&nbsp;&nbsp; logger =
CoreLogger.new(File.join(File.dirname(__FILE__),
&quot;#{fileNamePrefix}_#{time}.txt&quot;) ,2, 1000000)</span></font><span
lang=EN-US><o:p></o:p></span></p>

<p><font size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:
Arial'>Here the &nbsp;&quot;File.dirname(__FILE__)&quot; will return the
directory who stores test cases.</span></font><span lang=EN-US><o:p></o:p></span></p>

<p><font size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:
Arial'>Now I want get the directory upper of the directory of
&quot;File.dirname(__FILE__)&quot;, is there a equivalent function or Regexp in
Ruby/Watir as strrchr/substr in C to achieve this?</span></font><span
lang=EN-US><o:p></o:p></span></p>

<p><font size=3 face=Arial><span lang=EN-US style='font-size:12.0pt;font-family:
Arial'>&nbsp;</span></font><span lang=EN-US><o:p></o:p></span></p>

<p><font size=1 face=Arial><span lang=EN-US style='font-size:9.0pt;font-family:
Arial'>Any hint or help is appreciated.</span></font><span lang=EN-US><o:p></o:p></span></p>

<p><font size=3 face=Arial><span lang=EN-US style='font-size:12.0pt;font-family:
Arial'>&nbsp;</span></font><span lang=EN-US><o:p></o:p></span></p>

<p><font size=1 color=black face=Arial><span lang=EN-US style='font-size:9.0pt;
font-family:Arial;color:black'>Regards,</span></font><span lang=EN-US><o:p></o:p></span></p>

<p><font size=1 color=black face=Arial><span lang=EN-US style='font-size:9.0pt;
font-family:Arial;color:black'>Jason</span></font><span lang=EN-US><o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><br>
_______________________________________________<br>
Wtr-general mailing list<br>
<a href="mailto:Wtr-general@rubyforge.org">Wtr-general@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/wtr-general" target="_blank">http://rubyforge.org/mailman/listinfo/wtr-general</a><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span lang=EN-US
style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</body>

</html>