detect ledger filetype