 
 # Save to file
 write = (version)->
-  file = fs.CreateTextFile path(), true
-  file.WriteLine """
-    #{version or ''}
+  path().save version or '', """
+
 
     Start file from non-word character (eg # or ! or ; etc)
     to disable autodetection of #{PACKAGE.mingzi} new version available.
+
   """
-  file.Close()
 
 # Read version from file
 read = ->
   s = ''
-  if fs.FileExists f = path()
-    s = fs.OpenTextFile f
-    .ReadLine()
+  f = path()
+  if f.y()
+    s = f.load()
   s = s.replace /^\s+/, ''
   .split /\s+/, 2
   .shift()


# Path to file with latest version
path = ->
  fs.BuildPath cache, '.v'

# GitHub API URI
api = ->


# Touch file
touch = ->
  f = path()
  unless f.y()
    write()
    return
  # Emulate touch
  f.save f.load()

# Is file old?
expired = ->
  !path().ok 1000*60*60*24*3

# Autodetection allowed
autodetect = ->
