anchor.diff:  /// Compares the given files for changes
   /// If delete = true then equal files will be removed  
   let CompareFiles delete originalFileName compareFileName =  
  -  let ori = new FileInfo(originalFileName)
  -  let comp = new FileInfo(compareFileName)
  -
  -  let identical = 
  -    if not (ori.Exists && comp.Exists && ori.Length = comp.Length) then false else
  -    if ori.LastWriteTime = comp.LastWriteTime then true else
  -    FilesAreEqual ori comp
  -
  -  if not identical then false else
  -  if delete then      
  -      comp.Attributes <- FileAttributes.Normal
  -      comp.Delete()
  -      logVerbosefn "Deleting File: %s" comp.FullName
  -  else
  -      logVerbosefn "Files equal: %s" comp.FullName
  -  true
  +    let ori = new FileInfo(originalFileName)
  +    let comp = new FileInfo(compareFileName)
  +
  +    let identical = 
  +        if not (ori.Exists && comp.Exists && ori.Length = comp.Length) then false else
  +        if ori.LastWriteTime = comp.LastWriteTime then true else FilesAreEqual ori comp
  +
  +    if not identical then false else
  +    if delete then      
  +        comp.Attributes <- FileAttributes.Normal
  +        comp.Delete()
  +        logVerbosefn "Deleting File: %s" comp.FullName
  +    else
  +        logVerbosefn "Files equal: %s" comp.FullName
  +    true
   
     
   /// Checks if the directory exists
   let TestDir dir =
  -  let di = new DirectoryInfo(dir)
  -  
  -  if di.Exists then true else
  -  logfn "%s not found" di.FullName
  -  false
  +    let di = new DirectoryInfo(dir)
  +  
  +    if di.Exists then true else
  +    logfn "%s not found" di.FullName
  +    false
   
   /// Checks the srcFiles for changes to the last release
   ///  param lastReleaseDir: The directory of the last release
  
positive.code: ///            (string -> string -> string)
  ///            (newFile -> oldFileProposal)
  let GeneratePatchWithFindOldFileFunction lastReleaseDir patchDir srcFiles findOldFileF =
    srcFiles
      |> Seq.map (fun n -> 
           let newFile = toRelativePath n 
           let oldFile = findOldFileF newFile (lastReleaseDir + newFile.TrimStart('.'))
           let fi = new FileInfo(oldFile)
           if not fi.Exists then
              logVerbosefn "LastRelease has no file like %s" fi.FullName
           newFile,oldFile)         
      |> Seq.filter (fun (newF,oldF) -> CompareFiles false oldF newF |> not)
      |> Seq.iter (fun (newF,oldF) -> CopyFileIntoSubFolder patchDir newF)
  
  /// Checks the srcFiles for changes to the last release
  ///  param lastReleaseDir: The directory of the last release
  ///  param patchDir: The target directory
  ///  param srcFiles: The source files
  let GeneratePatch lastReleaseDir patchDir srcFiles =
    GeneratePatchWithFindOldFileFunction lastReleaseDir patchDir srcFiles (fun a b -> b)
negative.code: 
  /// Sets the directory readonly 
  let setDirectoryReadOnly readOnly (dir:DirectoryInfo) = 
      if dir.Exists then
          let isReadOnly = dir.Attributes &&& FileAttributes.ReadOnly = FileAttributes.ReadOnly
          if readOnly && (not isReadOnly) then 
              dir.Attributes <- dir.Attributes ||| FileAttributes.ReadOnly
          if (not readOnly) && not isReadOnly then               
              dir.Attributes <- dir.Attributes &&& (~~~FileAttributes.ReadOnly)  
  
  /// Sets all files in the directory readonly 
  let rec SetDirReadOnly readOnly (dir:DirectoryInfo) =
      dir.GetDirectories() |> Seq.iter (fun dir ->
          SetDirReadOnly readOnly dir
          setDirectoryReadOnly readOnly dir)
      dir.GetFiles() |> Seq.iter (fun file -> file.IsReadOnly <- readOnly)    
    
  /// Sets all files in the directory readonly 
  let SetReadOnly readOnly (files: string seq) =
      files |> Seq.iter (fun file ->
        let fi = new FileInfo(file)
        if fi.Exists then 
            fi.IsReadOnly <- readOnly
        else
            let di = new DirectoryInfo(file)
            setDirectoryReadOnly readOnly di)
        
        
  /// Deletes a directory if it exists
  let DeleteDir x =   
      let dir = new DirectoryInfo(x)    
      if dir.Exists then 
          // set all files readonly = false
          !+ "/**/*.*"
            |> SetBaseDir dir.FullName
            |> Scan
            |> (SetReadOnly false)
        
          logfn "Deleting %s" dir.FullName
          dir.Delete true
      else
        logfn "%s does not exist." dir.FullName
      
  /// Creates a directory if it does not exist
  let CreateDir x =   
      let dir = new DirectoryInfo(x)
      if not dir.Exists then 
         logfn "Creating %s" dir.FullName
         dir.Create()
      else
         logfn "%s does already exist." dir.FullName
      
  /// Creates a file if it does not exist
  let CreateFile x =   
      let file = new FileInfo(x)
      if not file.Exists then 
          logfn "Creating %s" file.FullName
          let newFile = file.Create()
          newFile.Close()
      else
          logfn "%s does already exist." file.FullName
      
  /// Deletes a file if it exist
  let DeleteFile x =   
      let file = new FileInfo(x)    
      if file.Exists then 
          logfn "Deleting %s" file.FullName
          file.Delete()
      else
          logfn "%s does not exist." file.FullName                
      
  let (|File|Directory|) (fileSysInfo : FileSystemInfo) =
      match fileSysInfo with
      | :? FileInfo as file -> File (file.Name)
      | :? DirectoryInfo as dir -> Directory (dir.Name, seq { for x in dir.GetFileSystemInfos() -> x })
      | _ -> failwith "No file or directory given."      
        
  /// Active Pattern for determining file extension
  let (|EndsWith|_|) extension (file : string) = if file.EndsWith extension then Some() else None
   
  /// Active Pattern for determining file name   
  let (|FileInfoFullName|) (f:FileInfo) = f.FullName
  