Last change
on this file since 256 was
256,
checked in by hendrikvanantwerpen, 13 years ago
|
Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).
|
File size:
669 bytes
|
Line | |
---|
1 | define(["../fileHandleThrottle"], function(fht) { |
---|
2 | var fs= require.nodeRequire("fs"); |
---|
3 | return { |
---|
4 | statSync:fs.statSync, |
---|
5 | mkdirSync:fs.mkdirSync, |
---|
6 | readFileSync:fs.readFileSync, |
---|
7 | writeFileSync:fs.writeFileSync, |
---|
8 | readdirSync:fs.readdirSync, |
---|
9 | |
---|
10 | readFile: function(filename, encoding, cb) { |
---|
11 | fht.enqueue(function(){ |
---|
12 | fs.readFile(filename, encoding, function(code){ |
---|
13 | fht.release(); |
---|
14 | cb.apply(null, arguments); |
---|
15 | }); |
---|
16 | }); |
---|
17 | }, |
---|
18 | |
---|
19 | writeFile: function(filename, contents, encoding, cb) { |
---|
20 | fht.enqueue(function(){ |
---|
21 | fs.writeFile(filename, contents, encoding, function(code){ |
---|
22 | fht.release(); |
---|
23 | cb.apply(null, arguments); |
---|
24 | }); |
---|
25 | }); |
---|
26 | } |
---|
27 | }; |
---|
28 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.