Skip to content

Modern Fs PathIsReserved

Paul Squires edited this page Oct 19, 2026 · 2 revisions

Home › Filesystem › Filesystem Library › PathIsReserved

PathIsReserved

Returns true if a part of the path is a Windows device name such as CON or NUL.

Syntax

PathIsReserved( p [, gram ] )

Notes

  • Under the Windows grammar, TRUE when any component is a reserved device name -- CON, PRN, AUX, NUL, CONIN$, CONOUT$, COM1-COM9, LPT1-LPT9 and their superscript-digit forms -- in any case, with or without an extension. Always FALSE under the POSIX grammar.

Examples

#import "std/fs"
using fs

print PathIsReserved( "logs" & chr( 92 ) & "Com1.txt", FB_PATH_WIN32 )    '' true
print PathIsReserved( "com10", FB_PATH_WIN32 )                           '' false
print PathIsReserved( "con", FB_PATH_POSIX )                             '' false

Library: Filesystem Library Category: Filesystem Documented under: Paths

Clone this wiki locally