Skip to content

Modern Fs GetFileId

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

Home › Filesystem › Filesystem Library › GetFileId

GetFileId

Returns the FileId of a path, which tells whether two paths are the same file.

Syntax

GetFileId( p [, followLinks ] )

Notes

  • The FileId of p, following a symbolic link unless followLinks is false.
  • Works for a directory as well as a file.

Examples

#import "std/fs"
#import "std/chrono"
using fs

dim as ustring dir_ = CreateTempDir( "tkdoc" ).Value( )
dim as ustring p = PathJoin( dir_, "f.txt" )
WriteAllText( p, "x" )
CreateHardLink( p, PathJoin( dir_, "twin.txt" ) )
print GetFileId( p ).Value( ) = GetFileId( PathJoin( dir_, "twin.txt" ) ).Value( )    '' true

RemoveDirAll( dir_ )

Library: Filesystem Library Category: Filesystem Documented under: Metadata

Clone this wiki locally