Class: Hello

Inherits:
Object
  • Object
show all
Defined in:
ext/dokan-ruby-0.1.5.1229/sample/test.rb,
ext/dokan-ruby-0.1.5.1229/sample/hello.rb

Instance Method Summary collapse

Constructor Details

#initializeHello

Returns a new instance of Hello.



6
7
8
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 6

def initialize
  @hello = "hello, world"
end

Instance Method Details

#cleanup(path, fileinfo) ⇒ Object



40
41
42
43
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 40

def cleanup(path, fileinfo)
  puts "#cleanup " + path
  true
end

#close(path, fileinfo) ⇒ Object



35
36
37
38
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 35

def close(path, fileinfo)
  puts "#close " + path
  true
end

#contents(path) ⇒ Object



9
10
11
12
# File 'ext/dokan-ruby-0.1.5.1229/sample/hello.rb', line 9

def contents path
  puts "##contents " + path
  ["hello.txt"]
end

#create(path, fileinfo) ⇒ Object



15
16
17
18
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 15

def create(path, fileinfo)
  puts "#create " + path
  false
end

#directory?(path) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
# File 'ext/dokan-ruby-0.1.5.1229/sample/hello.rb', line 19

def directory? path
  puts "##directory? " + path
  path == "/"
end

#file?(path) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
17
# File 'ext/dokan-ruby-0.1.5.1229/sample/hello.rb', line 14

def file? path
  puts "##file? " + path
  path  =~ /hello.txt/
end

#flush(path, fileinfo) ⇒ Object



59
60
61
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 59

def flush(path, fileinfo)
  true
end

#mkdir(path, fileinfo) ⇒ Object



30
31
32
33
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 30

def mkdir(path, fileinfo)
  puts "#mkdir " + path
  false
end

#open(path, fileinfo) ⇒ Object



10
11
12
13
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 10

def open(path, fileinfo)
  puts "#open " + path
  path == "/hello.txt" or path == "/"
end

#opendir(path, fileinfo) ⇒ Object



25
26
27
28
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 25

def opendir(path, fileinfo)
  puts "#opendir " + path
  true
end

#read(path, offset, length, fileinfo) ⇒ Object



45
46
47
48
49
50
51
52
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 45

def read(path, offset, length, fileinfo)
  puts "#read " + path
  if offset < @hello.length
    @hello[offset, length]
  else
    false
  end
end

#read_file(path) ⇒ Object



24
25
26
27
# File 'ext/dokan-ruby-0.1.5.1229/sample/hello.rb', line 24

def read_file path
  puts "##read_file " + path
  @msg
end

#readdir(path, fileinfo) ⇒ Object

def readdira(path, fileinfo)

end


78
79
80
81
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 78

def readdir(path, fileinfo)
  puts "#readdir " + path
  ["hello.txt"]
end

#remove(path, fileinfo) ⇒ Object



93
94
95
96
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 93

def remove(path, fileinfo)
  puts "#remove " + path
  false
end

#rename(path, newpath, fileinfo) ⇒ Object



98
99
100
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 98

def rename(path, newpath, fileinfo)
  false
end

#rmdir(path, fileinfo) ⇒ Object



102
103
104
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 102

def rmdir(path, fileinfo)
  false
end

#setattr(path, attr, fileinfo) ⇒ Object



83
84
85
86
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 83

def setattr(path, attr, fileinfo)
  puts "#setattr " + path
  false
end

#size(path) ⇒ Object



29
30
31
32
# File 'ext/dokan-ruby-0.1.5.1229/sample/hello.rb', line 29

def size path
  puts "##size " + path
  @msg.length
end

#stat(path, fileinfo) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 63

def stat(path, fileinfo)
  puts "#fstat " + path
  #[size, attr, ctime, atime, mtime]
  if path == "/hello.txt"
    [@hello.length, Dokan::NORMAL, 0, 0, 0]
  elsif path == "/"
    [0, Dokan::DIRECTORY, 0, 0, 0]
  else
    false
  end
end

#truncate(path, length, fileinfo) ⇒ Object



20
21
22
23
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 20

def truncate(path, length, fileinfo)
  puts "#truncate " + path
  false
end

#unmount(fileinfo) ⇒ Object



106
107
108
109
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 106

def unmount(fileinfo)
  puts "#unmount"
  true
end

#utime(path, ctime, atime, mtime, fileinfo) ⇒ Object



88
89
90
91
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 88

def utime(path, ctime, atime, mtime, fileinfo)
  puts "#utime " + path
  false
end

#write(path, offset, data, fileinfo) ⇒ Object



54
55
56
57
# File 'ext/dokan-ruby-0.1.5.1229/sample/test.rb', line 54

def write(path, offset, data, fileinfo)
  puts "#write " + path
  false
end