Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Chmod'ing a file #7729

Closed
xaddict opened this issue May 2, 2014 · 17 comments
Closed

Chmod'ing a file #7729

xaddict opened this issue May 2, 2014 · 17 comments

Comments

@xaddict
Copy link

xaddict commented May 2, 2014

I would like a feature on right-clicking a file in the tree where it gives me an option to change the chmod.

I work a lot with CMS'es and these sometimes tend to lock stuff. It would be very handy if there was a Coda-like 'info' screen where permissions can be changed and information about the file can be reviewed. It also would allow for an easy way to see and edit metadata without having to switching to the Finder constantly. The title could be clickable to instantly change the filename for example.

@zaggino
Copy link
Contributor

zaggino commented May 2, 2014

This is a good idea for an extension. Shouldn't be too hard to implement.

@marcelgerber
Copy link
Contributor

I like the idea of an info context menu entry. It could contain general infos like size, last changed and so on.

@JeffryBooher
Copy link
Contributor

@zaggino do you want to write an extension for this issue?

@JeffryBooher
Copy link
Contributor

Open to myself to track

@peterflynn
Copy link
Member

@JeffryBooher The 'tracking' tag is used to mean there's an external bug in some other bugbase that we're waiting on. That seems not to be the case here, so I'm removing that label.

@zaggino
Copy link
Contributor

zaggino commented May 11, 2014

@JeffryBooher I'd love to, but I'm currently too busy to take anything new on my shoulders.

@mackenza
Copy link
Contributor

mackenza commented Jun 1, 2014

I may give this one a try. I have been looking for how I might contribute to the project.

Do you think it will require access to a node module to gain access to file system functions like chmod?

@zaggino
Copy link
Contributor

zaggino commented Jun 1, 2014

Most probably will do @mackenza , at least that's the way I'd have done it. My idea would be to put a right click -> properties item to the file tree which would then open a dialog and show current chmod status for the entry and maybe some additional information too like file or directory size which you also can mine using node module.

If you're not very familiar with node in Brackets, you may find some inspiration here https://github.com/zaggino/brackets-git/blob/master/src/domains/cli.js which is a file the brackets-git extension uses to spawn commands and get their output. I'm happy to help if you run into problems, just ping me here at github.

@mackenza
Copy link
Contributor

mackenza commented Jun 1, 2014

ok, yeah, I see I can use the fs module so at least I won't have to add any node modules from NPM.

Yes, right-click->context menu->properties was how I was going to go. I can get the properties, including current permissions with fs.stat() and then try to set the new perms with fs.chmod().

I was thinking, since I am doing this in a dialog box, that synchronous calls should be done to fs. Does that seem logical to you?

@zaggino
Copy link
Contributor

zaggino commented Jun 1, 2014

Never use sync calls if you can avoid it, I don't see the benefit of it.

@zaggino
Copy link
Contributor

zaggino commented Jun 1, 2014

fs.chmod seems like a good idea but be warned - i tried using it and for some of my users it was failing because of some unknown permission problems - when I executed chmod natively using childProcess.spawn it worked without a problem.

I suggest start with fs.chmod but plan your architecture and modules for a case you'll have to switch to childProcess.spawn later.

@JeffryBooher JeffryBooher removed their assignment Jun 9, 2014
@JeffryBooher
Copy link
Contributor

Not sure why I was assigned since this is an issue / extension idea.

@mackenza
Copy link
Contributor

@zaggino @xaddict I have written a first crack at this and it seems to work on my Linux machine. I don't have a Mac to test on. On Windows, fs.chmodSync is of limited use due to the weirdness of Windows permissions (I think you can only affect the "read only" bit by changing the write bit). Nevertheless, it seems to work on Windows too.

Before I publish it to the Registry, it would be great if you could have a look and let me know of any issues and whether it actually address the use case of this issue.

repo is at https://github.com/mackenza/Brackets-FileSystemProperties

@mackenza
Copy link
Contributor

I think it seems good enough that I will upload it to the registry today. I can always iterate it later if issues pop up.

@zaggino
Copy link
Contributor

zaggino commented Jun 28, 2014

👍 @mackenza
sorry but I didn't have time to look at it yet, but it's saved on the todo list :)

@mackenza
Copy link
Contributor

no worries, we're all busy people doing this on our spare time ;)

@dangoor
Copy link
Contributor

dangoor commented Jul 22, 2014

thanks for the extension @mackenza. Closing this issue as this is not a core feature.

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

No branches or pull requests

7 participants