Module: Windows::Directory

Defined in:
lib/windows/directory.rb

Constant Summary collapse

CreateDirectory =
Win32API.new('kernel32', 'CreateDirectory', 'PP', 'I')
CreateDirectoryW =
Win32API.new('kernel32', 'CreateDirectoryW', 'PP', 'I')
CreateDirectoryEx =
Win32API.new('kernel32', 'CreateDirectoryEx', 'PPP', 'I')
CreateDirectoryExW =
Win32API.new('kernel32', 'CreateDirectoryExW', 'PPP', 'I')
FindCloseChangeNotification =
Win32API.new('kernel32', 'FindCloseChangeNotification', 'L', 'I')
FindFirstChangeNotification =
Win32API.new('kernel32', 'FindFirstChangeNotification', 'PIL', 'L')
FindNextChangeNotification =
Win32API.new('kernel32', 'FindNextChangeNotification', 'PIL', 'I')
GetCurrentDirectory =
Win32API.new('kernel32', 'GetCurrentDirectory', 'LP', 'L')
GetCurrentDirectoryW =
Win32API.new('kernel32', 'GetCurrentDirectoryW', 'LP', 'L')
ReadDirectoryChangesW =
Win32API.new('kernel32', 'ReadDirectoryChangesW', 'LPLILPPP', 'I')
RemoveDirectory =
Win32API.new('kernel32', 'RemoveDirectory', 'P', 'I')
RemoveDirectoryW =
Win32API.new('kernel32', 'RemoveDirectoryW', 'P', 'I')
SetCurrentDirectory =
Win32API.new('kernel32', 'SetCurrentDirectory', 'P', 'I')
SetCurrentDirectoryW =
Win32API.new('kernel32', 'SetCurrentDirectoryW', 'P', 'I')

Instance Method Summary collapse

Instance Method Details

#CreateDirectory(path, attributes = 0) ⇒ Object



20
21
22
# File 'lib/windows/directory.rb', line 20

def CreateDirectory(path, attributes = 0)
   CreateDirectory.call(path, attributes) != 0
end

#CreateDirectoryEx(template, new_dir, attributes) ⇒ Object



29
30
31
# File 'lib/windows/directory.rb', line 29

def CreateDirectoryEx(template, new_dir, attributes)
   CreateDirectoryEx.call(template, new_dir, attributes) != 0
end

#CreateDirectoryExW(template, new_dir, attributes) ⇒ Object



33
34
35
36
# File 'lib/windows/directory.rb', line 33

def CreateDirectoryExW(template, new_dir, attributes)
   new_dir = multi_to_wide(new_dir) unless IsTextUnicode(new_dir)
   CreateDirectoryExW.call(template, new_dir, attributes) != 0
end

#CreateDirectoryW(path, attributes) ⇒ Object



24
25
26
27
# File 'lib/windows/directory.rb', line 24

def CreateDirectoryW(path, attributes)
   path = multi_to_wide(path) unless IsTextUnicode(path)
   CreateDirectoryW.call(path, attributes) != 0
end

#FindCloseChangeNotification(handle) ⇒ Object



38
39
40
# File 'lib/windows/directory.rb', line 38

def FindCloseChangeNotification(handle)
   FindCloseChangeNotification.call(handle) != 0
end

#FindFirstChangeNotification(path, subtree, filter) ⇒ Object



42
43
44
# File 'lib/windows/directory.rb', line 42

def FindFirstChangeNotification(path, subtree, filter)
   FindFirstChangeNotification.call(path, subtree, filter)
end

#FindNextChangeNotification(handle) ⇒ Object



46
47
48
# File 'lib/windows/directory.rb', line 46

def FindNextChangeNotification(handle)
   FindNextChangeNotification.call(handle) != 0
end

#GetCurrentDirectory(buf_len, buf) ⇒ Object



50
51
52
# File 'lib/windows/directory.rb', line 50

def GetCurrentDirectory(buf_len, buf)
   GetCurrentDirectory.call(buf_len, buf)
end

#GetCurrentDirectoryW(buf_len, buf) ⇒ Object



54
55
56
# File 'lib/windows/directory.rb', line 54

def GetCurrentDirectoryW(buf_len, buf)
   GetCurrentDirectoryW.call(buf_len, buf)
end

#ReadDirectoryChangesW(handle, buf, buf_len, subtree, filter, bytes, overlapped, routine) ⇒ Object



58
59
60
# File 'lib/windows/directory.rb', line 58

def ReadDirectoryChangesW(handle, buf, buf_len, subtree, filter, bytes, overlapped, routine)
   ReadDirectoryChangesW.call(handle, buf, buf_len, subtree, filter, bytes, overlapped, routine) != 0
end

#RemoveDirectory(path) ⇒ Object



62
63
64
# File 'lib/windows/directory.rb', line 62

def RemoveDirectory(path)
   RemoveDirectory.call(path) != 0
end

#RemoveDirectoryW(path) ⇒ Object



66
67
68
69
# File 'lib/windows/directory.rb', line 66

def RemoveDirectoryW(path)
   path = multi_to_wide(path) unless IsTextUnicode(path)
   RemoveDirectoryW.call(path) != 0
end

#SetCurrentDirectory(path) ⇒ Object



71
72
73
# File 'lib/windows/directory.rb', line 71

def SetCurrentDirectory(path)
   SetCurrentDirectory.call(path) != 0
end

#SetCurrentDirectoryW(path) ⇒ Object



75
76
77
78
# File 'lib/windows/directory.rb', line 75

def SetCurrentDirectoryW(path)
   path = multi_to_wide(path) unless IsTextUnicode(path)
   SetCurrentDirectoryW.call(path) != 0
end