Skip to content

Modern Fs FileInfo NativeAttributes

Paul Squires edited this page Nov 9, 2026 · 6 revisions

Home › Filesystem › Filesystem Library › FileInfo.NativeAttributes

FileInfo.NativeAttributes

Returns the raw attribute word: attributes on Windows, mode bits on Linux and macOS.

Syntax

FileInfo.NativeAttributes( )

Notes

  • dwFileAttributes / st_mode

Examples

#import "std/fs"
using fs

dim td as FsResultUStr = CreateTempDir( "fbdoc" )
dim as ustring dir_ = td.Value( )
dim as ustring p = PathJoin( dir_, "f.txt" )
WriteAllText( p, "hello" )

'' The raw platform word: dwFileAttributes on Windows, st_mode on
'' POSIX.
dim info as FileInfo = Stat( p ).Value( )

print info.NativeAttributes( ) > 0       '' -1 (true)

'' CODE USING IT IS PLATFORM CODE, by definition -- the bits mean
'' different things on each side. Prefer IsReadOnly, IsHidden and the
'' rest wherever they cover the question.

RemoveDirAll( dir_ )

Library: Filesystem Library
Category: Filesystem
Documented under: Metadata

Clone this wiki locally