Skip to content

Commit

Permalink
fixing File so the Specs are passing again
Browse files Browse the repository at this point in the history
  • Loading branch information
kassens committed Jan 15, 2009
1 parent cf71f59 commit 7f8c2e5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
19 changes: 10 additions & 9 deletions Source/Data/File.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,29 +84,30 @@ var File = new Class({
},

// overrides the file
// +keeto: now uses Stream;
write: function(str, type, append){
var stream = new Stream(new air.FileStream());
stream.open(this.file, append ? 'append' : 'write');
stream.stream.open(this.file, append ? 'append' : 'write');
stream.write(str, type);
stream.close();
return this;
},

// appends str to the end of the file
// +keeto: edited arguments.
append: function(str, type){
return this.write(str, type, true);
},

// returns the content
// +keeto: now uses Stream;
read: function(){
var stream = new Stream(new air.FileStream());
stream.open(this.file, 'read');
var str = stream.read();
stream.close();
return str;
try {
var stream = new Stream(new air.FileStream());
stream.stream.open(this.file, 'read');
var str = stream.read();
stream.close();
return str;
} catch (e){
return null;
}
}

});
Expand Down
2 changes: 1 addition & 1 deletion Specs/Assets/Scripts/Builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var Builder = {
scripts: {
source: {
'Core': ['Aliases'],
'Data': ['File']
'Data': ['Stream', 'File']
},

specs: {
Expand Down

0 comments on commit 7f8c2e5

Please sign in to comment.