1. Carl Ådahl
  2. luasnips

Commits

Carl Ådahl  committed 92b85ae

sysfs: Fixed clobbering globals.

  • Participants
  • Parent commits 5431610
  • Branches default

Comments (0)

Files changed (1)

File sysfs.lua

View file
  • Ignore whitespace
 --[[
-luasysfs v0.1
+luasysfs v0.2
 Copyright (C) 2011 by Carl Ådahl
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
   Uses memoization to reduce IO at the cost of a little memory.
 
 Usage:
+  sys = require "sysfs"
   print("Temperature: " .. sys.class.thermal.thermal_zone0.temp / 1000 .. " C")
 
 ]]
 
 lfs = require "lfs"
 
-function readFile(path)
+local function readFile(path)
   local file = io.open(path, 'r')
   local line = file and file:read('*line')
   file:close()