std-file-attrib


Synopsis

(std-file-attrib <fname>)

Description

std-file-attrib returns an integer flag indicating the file attributes or nil if the file doesn't exist.
Flags:

1: read-only

2: hidden

4: system

8: archive

2048: compressed

Examples

(std-file-attrib "/acad/")  => 0
(std-file-attrib "/acad/test.lsp")  => 2060

(std-bitlist 2060) => (2048 8 4)
; the compressed, archive and system bits are set.

(defun file-readonly-p (fn)
  (std-bitsetp (std-file-attrib fn) 1))
(defun file-hidden-p (fn)
  (std-bitsetp (std-file-attrib fn) 2))

Arguments

fname: a string. A partial or fully qualified filename specifier.

Return Value

A number or nil. (Not used yet: Numbers exceeding the maximal integer size may be returned as real, else as integer)

Side Effects

None.

Module

Currently only implemented for doslib and stdlib14.arx

(std-require 'STDFILE)

Defined in STDFILE