Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to change osx file privileges ?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 4 - Last Post: Nov 15, 2017 1:17 PM Last Post By: Richard Simon
Richard Simon

Posts: 54
Registered: 10/7/07
How to change osx file privileges ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 15, 2017 6:51 AM
My application downloads a remote file using SFTP. Everything works fine on PC but on MAC after the file is downloaded it appears that it's privileges are set to "No Access". Within my application, how can I set the privileges of the downloaded, local file to something a little bit more useful? Thanks in advance.
Douglas Rudd

Posts: 314
Registered: 5/16/97
Re: How to change osx file privileges ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 15, 2017 10:41 AM   in response to: Richard Simon in response to: Richard Simon
Maybe has something to do with where you are downloading it to.
Your Mac app is "sandboxed" and therefore able to access only certain places.
Richard Simon

Posts: 54
Registered: 10/7/07
Re: How to change osx file privileges ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 15, 2017 11:47 AM   in response to: Douglas Rudd in response to: Douglas Rudd
Hi Douglas
Thanks for that.
The file is downloaded under the HomePath. A substructure of this folder contains many other files used by my application.. In this case (user : COMPANYNAME: APPLICATIONNAME: UPDATE). I wouldn't have anticipated a problem with that? If I go to Finder and do GetInfo on the downloaded file, that shows me that the file permissions are set to "No Access". I can reset it easily to "Read" or "Read & Write" within Finder. I just need to know how to do that operation in code within my application.
Thanks again.
Rick
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: How to change osx file privileges ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 15, 2017 12:05 PM   in response to: Richard Simon in response to: Richard Simon
Richard simon wrote:

The file is downloaded under the HomePath.

But HOW is it being downloaded? What library/API are you using?

I can reset it easily to "Read" or "Read & Write" within Finder.
I just need to know how to do that operation in code within my
application.

You will likely have to resort to using OSX-specific platform APIs to
set the permissions after the download is finished.

--
Remy Lebeau (TeamB)
Richard Simon

Posts: 54
Registered: 10/7/07
Re: How to change osx file privileges ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 15, 2017 1:17 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hi Remy
I am using SecureBridge to download.
I'm also trying to find out from them how to change permissions during the download process. I think I should be able to do it that way but I cant work out how to at the moment.
Thanks for your help.
Rick

Remy Lebeau (TeamB) wrote:
Richard simon wrote:

The file is downloaded under the HomePath.

But HOW is it being downloaded? What library/API are you using?

I can reset it easily to "Read" or "Read & Write" within Finder.
I just need to know how to do that operation in code within my
application.

You will likely have to resort to using OSX-specific platform APIs to
set the permissions after the download is finished.

--
Remy Lebeau (TeamB)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02