Method: Fasttrack::File#initialize
- Defined in:
- lib/fasttrack/file.rb
#initialize(path, mode = "r") ⇒ File
Instantiates a new Fasttrack::File object, which is a representation of a file on disk and its associated XMP metadata. To create a new file on disk you should use Fasttrack::XMP#to_s instead.
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/fasttrack/file.rb', line 51 def initialize path, mode="r" @open = false @path = Pathname.new(path). if not @path.exist? raise Errno::ENOENT, "#{@path} does not exist" end @file_ptr = Exempi.xmp_files_new @read_mode = mode open @read_mode ObjectSpace.define_finalizer(self, self.class.finalize(@file_ptr)) end |