Page 1 of 1
CheckFileName()
Posted: Sun Feb 23, 2025 5:38 pm
by the.weavster
PB 6.20 on MX Linux (Debian)
This returns zero:
I can't currently check other platforms...
// Moved from "Bugs - Linux" to "Coding Questions" (Kiffi)
Re: CheckFileName()
Posted: Sun Feb 23, 2025 6:10 pm
by AZJIO
The "/" symbol forbidden in the name
Re: CheckFileName()
Posted: Sun Feb 23, 2025 6:48 pm
by the.weavster
Ah, so it only checks the file name bit
I was using it to check a whole path string

Re: CheckFileName()
Posted: Sun Feb 23, 2025 6:56 pm
by AZJIO
Then you need FileSize()
Re: CheckFileName()
Posted: Sun Feb 23, 2025 9:03 pm
by the.weavster
AZJIO wrote: Sun Feb 23, 2025 6:56 pm
Then you need FileSize()
The path / file may not exist (yet), it's a string coming in from a script and I'm trying to perform a sanity check to make sure it could reasonably be interpreted as a path for the current OS.
Re: CheckFileName()
Posted: Sun Feb 23, 2025 10:00 pm
by Quin
the.weavster wrote: Sun Feb 23, 2025 9:03 pm
The path / file may not exist (yet), it's a string coming in from a script and I'm trying to perform a sanity check to make sure it could reasonably be interpreted as a path for the current OS.
CheckFileName() is what you want in this case, but the "/" character isn't allowed on Windows, so I think this function disallows it globally. As it turns out though, that's also the character separator on Linux...
At least on Windows it works for full paths using backslash.
Perhaps the "/" check should be limited to Windows only in PB itself?