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] Add fs.makedir() and fs.rename() APIs #71

Open
core-ai-bot opened this issue Aug 17, 2021 · 5 comments
Open

[CLOSED] Add fs.makedir() and fs.rename() APIs #71

core-ai-bot opened this issue Aug 17, 2021 · 5 comments

Comments

@core-ai-bot
Copy link
Member

Issue by gruehle
Wednesday Sep 26, 2012 at 14:24 GMT
Originally opened as adobe#120


Add two new functions to brackets.fs:

makedir()

/**
 * Create a new directory.
 *
 * @param {string} path The path of the directory to create.
 * @param {number} mode The permissions for the directory, in numeric format (ie 0777)
 * @param {function(err)} callback Asynchronous callback function. The callback gets one argument.
 *
 * @return None. This is an asynchronous call that sends all return information to the callback.
 **/
function makedir(path, mode, callback);

NOTE
The mode parameter of makedir() is ignored for now. The directory is created with the full
permissions available to the current user.

rename()

/**
 * Rename a file or directory.
 *
 * @param {string} oldPath The old name of the file or directory.
 * @param {string} newPath The new name of the file or directory.
 * @param {function(err)} callback Asynchronous callback function. The callback gets one argument.
 *
 * @return None. This is an asynchronous call that sends all return information to the callback.
 **/
function rename(oldPath, newPath, callback);

BONUS FEATURES
This pull request also includes two small bonus features on the mac:

  • The main window size and position is now remembered when quitting and relaunching Brackets. This change will also fix the issues on the Mac where some of the UI is not shown if the initial window size is too small (Display error on MacBook Pro (13") adobe/brackets#1689)
  • The file dialogs are now modal sheets instead of modal dialogs.

gruehle included the following code: https://github.com/adobe/brackets-shell/pull/120/commits

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Monday Oct 01, 2012 at 23:05 GMT


I am getting a build error on Mac OS X v10.6 due to the NSFileWriteFileExistsError flag is only available on OS X v10.7 and later.

@core-ai-bot
Copy link
Member Author

Comment by gruehle
Tuesday Oct 02, 2012 at 05:22 GMT


Thanks for reviewing!

Are you using XCode 4.x? XCode 3.2.6 is no longer supported.

I don't have a 10.6 system with me for testing, but this should be fine when running on a 10.6 system. If you try to rename an item to a name of an existing item, you will get a less friendly error message, but everything should work fine.

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Tuesday Oct 02, 2012 at 17:07 GMT


I'll take on the mac side of the review.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Tuesday Oct 02, 2012 at 17:23 GMT


Windows looks good. Re-assigning to @jasonsanjose to take a look at Mac (since I need to upgrade to Xcode 4).

@core-ai-bot
Copy link
Member Author

Comment by jasonsanjose
Wednesday Oct 03, 2012 at 18:19 GMT


Looks good. Merging

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