public Method

Dir.pos=(p1)

dir.pos( integer )  integer

Synonym for Dir#seek, but returns the position parameter.

d = Dir.new("testdir")   #=> #<dir:0x401b3c40>
d.read                   #=> "."
i = d.pos                #=> 12
d.read                   #=> ".."
d.pos = i                #=> 12
d.read                   #=> ".."</dir:0x401b3c40>

Source Code

/*
*  call-seq:
*     dir.pos( integer ) => integer
*
*  Synonym for <code>Dir#seek</code>, but returns the position
*  parameter.
*
*     d = Dir.new("testdir")   #=> #<Dir:0x401b3c40>
*     d.read                   #=> "."
*     i = d.pos                #=> 12
*     d.read                   #=> ".."
*     d.pos = i                #=> 12
*     d.read                   #=> ".."
*/
static VALUE
dir_set_pos(dir, pos)
   VALUE dir, pos;
{
   dir_seek(dir, pos);
   return pos;
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.