Yes we need more code.
But when you debug, the obvious two variables to look at are:
- dir
- file_name
because both of them can contain extra slashes.
Also note that Windows uses backward slashes \ , not forward slashes /....
There are normalizing functions (like excludetrailingpathdelimiter and family) and variables (PathDelimiter) for that in sysutils, I believe.