summaryrefslogtreecommitdiffstats
path: root/api/examples/gfapi.py
diff options
context:
space:
mode:
Diffstat (limited to 'api/examples/gfapi.py')
-rwxr-xr-xapi/examples/gfapi.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/api/examples/gfapi.py b/api/examples/gfapi.py
index 7d7a5bab12d..f89996d9a10 100755
--- a/api/examples/gfapi.py
+++ b/api/examples/gfapi.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
from ctypes import *
+from ctypes.util import find_library
import os
import sys
import time
@@ -8,9 +9,9 @@ import types
# Looks like ctypes is having trouble with dependencies, so just force them to
# load with RTLD_GLOBAL until I figure that out.
-glfs = CDLL("libglusterfs.so",RTLD_GLOBAL)
-xdr = CDLL("libgfxdr.so",RTLD_GLOBAL)
-api = CDLL("libgfapi.so",RTLD_GLOBAL)
+glfs = CDLL(find_library("glusterfs"),RTLD_GLOBAL)
+xdr = CDLL(find_library("gfxdr"),RTLD_GLOBAL)
+api = CDLL(find_library("gfapi"),RTLD_GLOBAL)
# Wow, the Linux kernel folks really play nasty games with this structure. If
# you look at the man page for stat(2) and then at this definition you'll note
@@ -98,6 +99,7 @@ class File(object):
def write (self, data, flags=0):
return api.glfs_write(self.fd,data,len(data),flags)
+
class Dir(object):
def __init__ (self, fd):