Browse Source

Try to prevent "Errno::ENOENT: No such file or directory @ rb_sysopen".

Martin Edenhofer 10 years ago
parent
commit
d8d506ea44
1 changed files with 6 additions and 5 deletions
  1. 6 5
      lib/sessions.rb

+ 6 - 5
lib/sessions.rb

@@ -32,12 +32,13 @@ returns
     path = @path + '/' + client_id.to_s
     FileUtils.mkpath path
     meta[:last_ping] = Time.new.to_i.to_s
+    data = {
+      user: session,
+      meta: meta,
+    }
+    content = data.to_s
     File.open( path + '/session', 'wb' ) { |file|
-      data = {
-        user: session,
-        meta: meta,
-      }
-      file.write data.to_json
+      file.write content
     }
 
     # send update to browser