Skip to content

fix(PE-1451): correct MatchFiles usage in autozip.brs DoesFileExist - #130

Open
evan-morgan wants to merge 1 commit into
mainfrom
PE-1451-fix-matchfiles-doesfileexist
Open

fix(PE-1451): correct MatchFiles usage in autozip.brs DoesFileExist#130
evan-morgan wants to merge 1 commit into
mainfrom
PE-1451-fix-matchfiles-doesfileexist

Conversation

@evan-morgan

@evan-morgan evan-morgan commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📝 Description

DoesFileExist() in the autorun.zip example's autozip.brs always returned false, even when the target file existed, because it called MatchFiles(filePath$, filePath$) with the full file path as both arguments. Per the BrightSign MatchFiles(path, pattern_in) contract, the first argument must be a directory and the pattern must not contain a directory separator, otherwise it returns zero results. This broke the zip-exists and already-extracted checks that drive the whole extraction flow.

Issue: PE-1451

📋 List of Changes

  • DoesFileExist() now splits the incoming path into its directory and filename parts and calls MatchFiles(dirPath$, fileName$) correctly.

🧪 Steps to Test

  1. Build the autorun-zip-package example and place autorun.zip at the root of an SD card.
  2. Boot a player (BrightSignOS 7.0.60+) with the card inserted.
  3. Confirm the debugger log shows the zip is detected, extracted, and renamed to autorun.zip.done, and the player reboots into the extracted app instead of failing the DoesFileExist check.

Notes to the Reviewer

Root cause was confirmed against the BrightSign developer docs (Global Functions > MatchFiles) and against a debugger repro from a partner (Guillaume Proux) showing MatchFiles("SD:", "autorun.zip") succeeds while MatchFiles("SD:/autorun.zip", "SD:/autorun.zip") does not.

📸 Screenshots

N/A

✔️ Dev Complete Checklist

  • PR template filled out
  • Change is tested by submitter
  • PR follows all linting and coding standards
  • Github Issue exists (if applicable)
  • Team member has been assigned
  • At least one commit message is in Conventional Commit format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants