# DIR

Updated: 10/19/2021, 9:29:48 PM
Created: 10/19/2021, 9:29:48 PM
Last Updated By: Kevin Munoz
Read Time: 1 minute(s)

Tags: file information

# Description

The DIR() function is used to return information about a file. It takes the general form:

DIR(filename)
1

Where filename is a string argument representing the relative or absolute path of a file or directory. This function returns a dynamic array with four attributes.

Attribute Description
1 File size in bytes
2 last modified date (in internal format)
3 last modified time (in internal format)
4 D if the filename is a directory, null otherwise

An example of use is as follows:

    info = DIR(".")

    CRT "DIR info returned is : " : OCONV(info, "MCP")
1
2
3

to assign file information to variable info, which can then be interrogated.

An example of the results provided is as follows:

DIR info returned is : 4096^19087^60171^D
1

Go back to jBASE BASIC

Go back to Programmers' Reference Guide