 # ---------------
 
 File =
+
   # Write user object to file
   write: (user) ->
     deferred = Q.defer()

  redis = redis.createClient()

# Set up
redis.flushdb()
redis.setnx "users:index", "-1"

# ---------------

      fs.writeFile(path, data, deferred.resolve)
    return deferred.promise

  # Read user file
  read: (id) ->
    deferred = Q.defer()
    [path, folder] = User.filename(id)
    fs.readFile path, (err, buffer) =>
      if err then return deferred.reject("err_no_user")
      data = shrink.expand msgpack.unpack(buffer)
      deferred.resolve(data)
    return deferred.promise

  # Delete user file
  del: (id) ->
    deferred = Q.defer()
