ftools.rb: Extra tools for the File class


WATANABE, Hirofumi


Zachary Landau

This library can be distributed under the terms of the Ruby license. You can freely distribute/modify this library.

It is included in the Ruby standard library.


ftools adds several (class, not instance) methods to the File class, for copying, moving, deleting, installing, and comparing files, as well as creating a directory path. See the File class for details.

FileUtils contains all or nearly all the same functionality and more, and is a recommended option over ftools

When you

require 'ftools'

then the File class aquires some utility methods for copying, moving, and deleting files, and more.

See the method descriptions below, and consider using FileUtils as it is more comprehensive.


  • copy
  • move
  • compare
  • safe_unlink
  • makedirs


Separator = separator

SEPARATOR = separator

ALT_SEPARATOR = rb_obj_freeze(rb_str_new2("\\"))


PATH_SEPARATOR = rb_obj_freeze(rb_str_new2(PATH_SEP))

BUFSIZE = 8 * 1024


Show files where this class is defined (3 files)
Register or log in to add new notes.
March 3, 2009
9 thanks

File class documentation

Most of the File class documentation is located in IO class docs. What you see here is what ‘ftools’ gives you.