Platform-specific file path delimiters

Sebastien Nouat sebastien.nouat at livecode.com
Wed Sep 23 13:30:38 EDT 2015


Hi Richard,

On 23/09/2015 17:53, Richard Gaskin wrote:
> A regression with UNC paths was recently fixed:
> <http://quality.runrev.com/show_bug.cgi?id=15814>
>
> Most interesting to me there is that it allows the use of the 
> Windows-specific "\" as a file path delimiter.
The regression 15814 was due to a refactoring of the path solving, to 
make sure it was done the same way everywhere. And by doing this, we 
removed the fact that in some places, paths starting with '\' or '\\' 
were accepted as LiveCode paths.

The fix for this regression was to close our eyes on paths starting with 
'\' or '\\', and leave them as they are. That certainly boils down to 
re-introducing a bug, but since backslash-delimited paths used to work 
sometimes, and people reported that it was no longer working, we chose 
to make people happy and allow the use of absolute, backslash-delimited 
paths.
>
> I didn't know OS-specific delimiters could be used.
>
> Can I use backslash in all file I/O calls in Windows?  What are the 
> rules that would let me know when I can can use platform-specific file 
> path delimiters, and when I need to use the customary Unix-style "/" 
> as we normally see on all platforms?
>

LiveCode uses the same path delimiter on every platform: '/'. Please, 
avoid using backslash (for your sake), as using backslashes in relative 
paths will certainly keep creating paths mixing forward and backward 
slashes in the engine.

Warm regards,

-- 
Sébastien Nouat
LiveCode Development Team





More information about the use-livecode mailing list