parameters: (src, dst, relative=None)
docstring: Create a finder alias
docstring_summary: Create a finder alias
docstring_tokens: Create a finder alias
function: def mkalias(src, dst, relative=None):
      """Create a finder alias"""
      srcfsr = File.FSRef(src)
      # The next line will fail under unix-Python if the destination
      # doesn't exist yet. We should change this code to be fsref-based.
      dstdir, dstname = os.path.split(dst)
      if not dstdir: dstdir = os.curdir
      dstdirfsr = File.FSRef(dstdir)
      if relative:
          relativefsr = File.FSRef(relative)
          # ik mag er geen None in stoppen :-(
          alias = File.FSNewAlias(relativefsr, srcfsr)
      else:
          alias = srcfsr.FSNewAliasMinimal()
  
      dstfsr, dstfss = Res.FSCreateResourceFile(dstdirfsr, unicode(dstname),
          File.FSGetResourceForkName())
      h = Res.FSOpenResourceFile(dstfsr, File.FSGetResourceForkName(), 3)
      resource = Res.Resource(alias.data)
      resource.AddResource('alis', 0, '')
      Res.CloseResFile(h)
  
      dstfinfo = dstfss.FSpGetFInfo()
      dstfinfo.Flags = dstfinfo.Flags|0x8000    # Alias flag
      dstfss.FSpSetFInfo(dstfinfo)
function_tokens: def mkalias ( src , dst , relative = None ) : srcfsr = File . FSRef ( src ) # The next line will fail under unix-Python if the destination # doesn't exist yet. We should change this code to be fsref-based. dstdir , dstname = os . path . split ( dst ) if not dstdir : dstdir = os . curdir dstdirfsr = File . FSRef ( dstdir ) if relative : relativefsr = File . FSRef ( relative ) # ik mag er geen None in stoppen :-( alias = File . FSNewAlias ( relativefsr , srcfsr ) else : alias = srcfsr . FSNewAliasMinimal ( ) dstfsr , dstfss = Res . FSCreateResourceFile ( dstdirfsr , unicode ( dstname ) , File . FSGetResourceForkName ( ) ) h = Res . FSOpenResourceFile ( dstfsr , File . FSGetResourceForkName ( ) , 3 ) resource = Res . Resource ( alias . data ) resource . AddResource ( 'alis' , 0 , '' ) Res . CloseResFile ( h ) dstfinfo = dstfss . FSpGetFInfo ( ) dstfinfo . Flags = dstfinfo . Flags | 0x8000 # Alias flag dstfss . FSpSetFInfo ( dstfinfo )