Skip to content

NextFile

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions

Blitz3DBlitzPlusBlitzBasic

NextFile

NextFile:String dir:Int32
Parameter Mode Type Default Description
dir In Int32 required The folder handle from ReadDir.

Returns: A file or folder name without its path, or an empty string at the end.

Description

Returns the name of the next entry of a folder opened with ReadDir. The names . and .. are among them, and the order is up to the file system. An empty string means there are no more.

Examples

CreateDir "files_next_example"
file = WriteFile("files_next_example/only.txt")
CloseFile file
dir = ReadDir("files_next_example")
Repeat
	name$ = NextFile$(dir)
	If name$ = "" Then Exit
	If name$ <> "." And name$ <> ".." Then Print name$
Forever
CloseDir dir
DeleteFile "files_next_example/only.txt"
DeleteDir "files_next_example"
only.txt

Related Commands

CloseFile, CopyFile, DeleteFile, FilePos, OpenFile, ReadFile, SeekFile, WriteFile

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally