On Oct 9, 2018, at 8:50 AM, Jody Bevan via 4D_Tech <4d_tech@lists.4d.com> wrote:
> 
> I love writing logs to the local computer while it is running. These log 
> files are for the programmers to know what is occurring on the computer. 
> Typically these logs are turned off when there are no problems in the 
> application. They are used extensively when an application is first handed to 
> the users in Alpha or beta form. This way we know much better where the 
> problems are, often being able to fix the issue before they even report it to 
> us. These files do not contain sensitive data.
> 
> Last week I decided I should actually test this out with switching computer 
> users. 
> 
> On the MacOS we have been writing this information we write to the Shared 
> folder. The pathname would be:
> 
> ~/Users/Shared/ApplicationName/Logs/LogFileName.txt

This is probably just an artifact of writing the email, but you should remove 
the tilde in front of the path. When you convert from posix path, the tilde 
will cause the path to become: 

/Users/<current_user>/Users/Shared/ApplicationName/Logs/LogFileName.txt


> This has been working great when I am signed in as myself, or if the computer 
> user does not changed. 
> A quick check in Terminal shows me the directories and files are created, and 
> I can write to them as needed.
> -rw-r—r—
> Or in Octal format 644
> 
> This is fine for the currently signed in user, but not for other users.
> 
> Not a problem I am thinking, I will just call terminal from within 4D at 
> startup and use the chmod command to change the permissions of the folders 
> and files if they are not read write for all users.
> 
> I suspect I am doing something stupid because it is not working.

Assuming you are actually putting the files in /Users/Shared/

1. You have to change permissions for the directories you created too.
2. You can only change permissions if you are the user who created those 
directories/files.

So if you run chmod when you create the files/directories, it should work fine. 
If you’re running chmod at startup when logging in as another user, it won’t 
work.

Jim Crate

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to