Don't allow Atom to open files larger than 1MB

Temporary measure until we can get this working with telepath.
This commit is contained in:
probablycorey
2013-10-17 10:41:17 -07:00
parent 450eba0d54
commit 2000e43053

View File

@@ -1,3 +1,4 @@
fs = require 'fs'
path = require 'path'
pathWatcher = require 'pathwatcher'
Q = require 'q'
@@ -76,6 +77,9 @@ class File
if not @exists()
promise = Q(null)
else if not @cachedContents? or flushCache
if fs.statSync(@getPath()).size >= 1048576 # 1MB
throw new Error("Atom can only handle files < 1MB, for now.")
deferred = Q.defer()
promise = deferred.promise
content = []