<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    CAD::AutoCAD::Detect - Detect AutoCAD files through magic string.

SYNOPSIS
     use CAD::AutoCAD::Detect qw(detect_dwg_file);

     my $dwg_flag = detect_dwg_file($file);

DESCRIPTION
    This Perl module detect AutoCAD files through magic string.

    List of supported files: dwg

SUBROUTINES
  "detect_dwg_file"
     my $dwg_flag = detect_dwg_file($file);

    Detect DWG file.

    Returns 1/0.

ERRORS
     detect_dwg_file():
             Cannot close file '%s'.
             Cannot open file '%s'.

EXAMPLE1
     use strict;
     use warnings;

     use CAD::AutoCAD::Detect qw(detect_dwg_file);
     use File::Temp qw(tempfile);
     use IO::Barf qw(barf);
     use MIME::Base64;

     # Data in base64.
     my $data = &lt;&lt;'END';
     QUMxMDAyAAAAAAAAAAAAAAAK
     END

     # Temp file.
     my (undef, $temp_file) = tempfile();

     # Save data to file.
     barf($temp_file, decode_base64($data));

     # Check file.
     my $dwg_flag = detect_dwg_file($temp_file);

     # Print out.
     if ($dwg_flag) {
             print "File '$temp_file' is DWG file.\n";
     } else {
             print "File '$temp_file' isn't DWG file.\n";
     }

     # Output like:
     # File '%s' isn't DWG file.

EXAMPLE2
     use strict;
     use warnings;

     use CAD::AutoCAD::Detect qw(detect_dwg_file);

     # Arguments.
     if (@ARGV &lt; 1) {
             print STDERR "Usage: $0 file\n";
             exit 1;
     }
     my $file = $ARGV[0];

     # Check DWG file.
     my $dwg_flag = detect_dwg_file($file);

     # Print out.
     if ($dwg_flag) {
             print "File '$file' is DWG file.\n";
     } else {
             print "File '$file' isn't DWG file.\n";
     }

     # Output:
     # Usage: detect-dwg-file file

DEPENDENCIES
    CAD::AutoCAD::Version, Error::Pure, Exporter, List::MoreUtils, Readonly.

REPOSITORY
    &lt;https://github.com/michal-josef-spacek/CAD-AutoCAD-Detect&gt;

AUTHOR
    Michal Josef Е&nbsp;paДЌek &lt;mailto:skim@cpan.org&gt;

    &lt;http://skim.cz&gt;

LICENSE AND COPYRIGHT
    В© 2020 Michal Josef Е&nbsp;paДЌek

    BSD 2-Clause License

VERSION
    0.01

</pre></body></html>