/* Remove the object named "Prefs" from the SYS: drawer display;
      
        
        * note that this will affect only the display, the drawer will
        * still remain on the file system, and telling Workbench to
        * rescan the drawer will reveal it again.
        */
        
       
    BPTR lock,old_dir;
    lock = Lock("SYS:",SHARED_LOCK);
    UpdateWorkbench("Prefs",lock,UPDATEWB_ObjectRemoved);
    UnLock(lock);
    /* Change the name of the file "RAM:Thursday"
      
        
        * to "Friday"; this works by first removing the
        * object from the display, renaming the object
        * and then telling Workbench that the object has
        * changed.
        */
        
       
    lock = Lock("RAM:",SHARED_LOCK);
    UpdateWorkbench("Thursday",lock,UPDATEWB_ObjectRemoved);
    old_dir = CurrentDir(lock);
    Rename("Thursday","Friday");
    CurrentDir(old_dir);
    UpdateWorkbench("Friday",lock,UPDATEWB_ObjectAdded);
    UnLock(lock);