Skip to content

Fix DIRECTORY() to test for a directory instead of a file spec - #2137

Open
Irwin1985 wants to merge 1 commit into
devfrom
fix/vfp-directory
Open

Irwin1985 wants to merge 1 commit into
devfrom
fix/vfp-directory

Conversation

@Irwin1985

@Irwin1985 Irwin1985 commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

DIRECTORY() went through the VO Directory() function, which searches for files matching a file spec. A directory name without wildcards never matches a file, so it always returned .F., and nFlags was accepted and ignored. It now checks the directory itself and honours the flag.

I measured the borders against VFP 9 because the help does not cover them: only nFlags 1 ignores the Hidden and System attributes, 2 behaves like 0, and a drive root is reported as found even though Windows marks it Hidden and System.

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.

1 participant