Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSED] Basic file writing API support #21

Open
core-ai-bot opened this issue Aug 29, 2021 · 1 comment
Open

[CLOSED] Basic file writing API support #21

core-ai-bot opened this issue Aug 29, 2021 · 1 comment

Comments

@core-ai-bot
Copy link
Member

Issue by jasonsanjose
Friday Dec 16, 2011 at 07:49 GMT
Originally opened as adobe/brackets#17


Minimum API for overwriting existing files:

// overwrite 'log.txt' with new content
directoryEntry.getFile('log.txt', {create: false}, function(fileEntry) {

// Create a FileWriter object for our FileEntry (log.txt).
fileEntry.createWriter(function(fileWriter) {

  fileWriter.onwriteend = function(e) {
    console.log('Write completed.');
  };

  fileWriter.onerror = function(e) {
    console.log('Write failed: ' + e.toString());
  };

  fileWriter.write("this should be a Blob, using strings for now");

}, errorHandler);

}, errorHandler);

@njx Still buggy. _FileWriter.write() is called with this === window. Need some debugging help tomorrow morning.


jasonsanjose included the following code: https://github.com/adobe/brackets/pull/17/commits

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Friday Dec 16, 2011 at 17:11 GMT


@njx fixed the _FileWriter bug. Ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant