MAC: Lock File Permission

Microchip External Memory Programmer

External Memory Programmer
MAC: Lock File Permission

When using serial port communication on a MAC OS, the serial library used by the memory_programmer needs to be able to lock the serial port. By locking the serial port, no other application will be able to access the serial port while the memory_programmer is using it. For the reason, the memory_programmer must has permission by the MAC operating system to be able to lock files. 


Here are the following steps that can be preformed in the command line interface to grant lock permission to memory programmer. 


  1. Make /var/spool/uucp and /var/lock directories if they do not exist.
    sudo mkdir /var/spool/uucp
    sudo mcdir /var/lock


  1. Change the permission and group of the made directories
    sudo chmod 775 /var/spool/uucp
    sudo chmod 775 /var/lock
    sudo chgrp uucp /var/spool/uucp
    sudo chgrp uucp /var/lock


  1. Confirm the permission and group of the made directories. The output is shown if operation is correct.
    ls -l /var/spool/ | grep uucp
    >drwxrwxr-x 2_uucp_uucp 68 5 19 03:15 uucp

    ls - /var/ | grep lock
    >drwxrwxr-x 20 root_uucp 680 10 7 14:26 lock


  1. Confirm the USER ID. You USER ID is shown as taro.
    who -H am i
    >taro    ttys000 Oct 7 15:28


  1. Append your account to the membership of the UUCP group. Please user your own USER ID for taro.
    1. For MAC OS 10.4
        sudo niutil -appendprop / /groups/uucp users taro
  1. For MAC OS 10.5 or 10.6
        sudo dscl . -append /Groups/uucp GroupMembership taro


  1. Confirm the setting of the UUCP group, where taro is the USER ID.
    dscl . -read /Groups/uucp | grep GroupMembership
    > GroupMembership: taro
External Memory Programmer
Version 2.3.2
Release: July, 2012
Copyright (c) 2012 Microchip Technology, Inc. All rights reserved