lock = CreateDir( name )
    D0                 D1
    BPTR CreateDir(STRPTR)
    
   
  
    CreateDir() creates a new directory with the specified name. An error is returned if it fails.  Directories can only be created on devices which support them, e.g. disks.  CreateDir() returns an exclusive 
Lock on the new directory if it succeeds.
  
    CreateDir() can be expected to return an exclusive 
Lock to the directory just created. You may want to either change the 
Lock type to SHARED_LOCk via 
ChangeMode() or, alternatively, 
UnLock() it and then use 
Lock(name, SHARED_LOCK) to obtain a shared Lock. Exclusive locks cannot be used with functions such as 
DupLock() or 
NameFromLock(), which is why you may want to avoid them.