Skip to content
CCPEDIAby Unity Nodes
App Development

Extract Daml source files from a DAR?

4 posts216 views4 likesLast activity Jul 2026

  1. WallaceKellyOP

    How can I extract the Daml source files from a DAR?
    (assuming they have not been removed)

  2. WallaceKelly 2

    The following works on macOS:

    unzip some.dar '*.daml'
    
  3. WallaceKelly 1

    Keep in mind that there is no guarantee that the embedded Daml source files are exactly the same as the source files used to compile the DAR.

    DAR files are in in the zip format (similar to Java ecosystem’s JAR files). The Daml source files are included in the DAR files for convenience. However, replacing them does not invalidate the DAR file.

  4. Simon_Letort

    Bash script to extract all .daml files from .dar archives in the current directory

    #!/bin/bash
    
    # Script to extract all .daml files from .dar archives in the current directory
    
    for dar_file in *.dar; do
       if [ -f "$dar_file" ]; then
          echo "Extracting .daml files from: $dar_file"
          unzip -o "$dar_file" '*.daml'
       fi
    done
    
    echo "Done extracting .daml files from all .dar archives"