From d8d506ea44037abfb79555e4ac01a7a6efaff8e2 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sun, 3 May 2015 10:40:10 +0200 Subject: [PATCH] Try to prevent "Errno::ENOENT: No such file or directory @ rb_sysopen". --- lib/sessions.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/sessions.rb b/lib/sessions.rb index 7fec193e9..d95cbd1fb 100644 --- a/lib/sessions.rb +++ b/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