how to crosslanguage store & access small file use redis,here is soluation
python store
#!/usr/bin/env python
import os.path
f=open("/home/mlzboy/1.png","rb")
s=os.path.getsize("/home/mlzboy/1.png")
print s
import redis
r = redis.StrictRedis(host='localhost', port=6379, db=0)
print r.set("foo",f.read())
b=r.get("foo")
ff=open("/home/mlzboy/2.png","wr")
ff.write(b)
ff.close
ruby read
#encoding=utf-8
#!/usr/bin/env ruby
require "redis"
redis = Redis.new
new_array=redis.get "foo"
f=File.new("/home/mlzboy/3.png","wb")
f.write(new_array)
f.close
查看更多关于how to crosslanguage store & access small file use的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did41519