' Directory and file operations: MKDIR, CHDIR, RMDIR, KILL, NAME, FILECOPY
#COMPILE EXE
#DIM ALL

FUNCTION PBMAIN() AS LONG
    MKDIR "test_subdir"
    PRINT "MKDIR test_subdir - OK"

    CHDIR "test_subdir"
    PRINT "CHDIR to test_subdir - OK"
    CHDIR ".."
    PRINT "CHDIR back - OK"

    OPEN "test_move.txt" FOR OUTPUT AS #1
        PRINT #1, "File to rename"
    CLOSE #1

    NAME "test_move.txt" AS "test_renamed.txt"
    PRINT "NAME (rename) - OK"

    KILL "test_renamed.txt"
    PRINT "KILL (delete) - OK"

    RMDIR "test_subdir"
    PRINT "RMDIR (remove dir) - OK"

    PRINT "Directory operations complete."

    FUNCTION = 0
END FUNCTION
