<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@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;
        text-align:justify;
        text-justify:inter-ideograph;
        font-size:10.5pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:9.0pt;
        font-family:SimSun;}
 /* Page Definitions */
 @page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 126.65pt 72.0pt 126.65pt;
        layout-grid:15.6pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=ZH-CN link=blue vlink=purple style='text-justify-trim:punctuation'>

<div class=Section1 style='layout-grid:15.6pt'>

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

<p class=MsoPlainText><font face=Arial><span lang=EN-US style='font-family:
Arial'><o:p>&nbsp;</o:p></span></font></p>

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

<p class=MsoPlainText><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.<o:p></o:p></span></font></p>

<p class=MsoPlainText><font face=Arial><span lang=EN-US style='font-family:
Arial'><o:p>&nbsp;</o:p></span></font></p>

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

<p class=MsoPlainText><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)<o:p></o:p></span></font></p>

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

<p class=MsoPlainText><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 &#8220;File.dirname(__FILE__)&#8221;, is there a equivalent function
or Regexp in Ruby/Watir as strrchr/substr in C to achieve this?<o:p></o:p></span></font></p>

<p class=MsoPlainText><font face=Arial><span lang=EN-US style='font-family:
Arial'><o:p>&nbsp;</o:p></span></font></p>

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

<p class=MsoPlainText><font face=Arial><span lang=EN-US style='font-family:
Arial'><o:p>&nbsp;</o:p></span></font></p>

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

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

</div>

</body>

</html>