 {Emitter} = require 'emissary'
 _ = require 'underscore-plus'
 fs = require 'fs-plus'
+runas = require 'runas'
 
 # Public: Represents an individual file.
 #

  getDigest: ->
    @digest ? @setDigest(@readSync())

  handleNativeChangeEvent: (eventType, path) ->
    if eventType is "delete"
      @unsubscribeFromNativeChangeEvents()

  write: (text) ->
    previouslyExisted = @exists()
    @cachedContents = text
    @writeFileWithPrivilegeEscalationSync(@getPath(), text)
    @subscribeToNativeChangeEvents() if not previouslyExisted and @hasSubscriptions()

  # Deprecated
