FYI,
I was just doing some testing with the File Manipulation Functions using v2.21.10 on Windows. I used the sample function below to get a sorted directory listing of a network drive. The network drive has 78 directories and 185 files. With sorting disabled the timings were:-
1 2010-11-22 12:26:08.299
2 2010-11-22 12:26:08.299
3 2010-11-22 12:26:08.612
With sorting active:-
1 2010-11-22 12:29:32.711
2 2010-11-22 12:29:32.726
3 2010-11-22 12:29:47.426
Seems rather a long time to sort so few items... For comparison, a dir /os command returns a sorted list instantly.
David
FUNCTION showDir(path)
DEFINE path STRING
DEFINE child STRING
DEFINE handle INTEGER
IF NOT os.Path.exists(path) THEN
RETURN
END IF
DISPLAY "[", path, "]"
DISPLAY "1 ",CURRENT
CALL os.Path.dirfmask(1+2+4)
DISPLAY "2 ",CURRENT
CALL os.Path.dirsort("size",1)
LET handle = os.Path.diropen(path)
DISPLAY "3 ",CURRENT
WHILE handle > 0
LET child = os.Path.dirnext(handle)
IF child IS NULL THEN EXIT WHILE END IF
DISPLAY os.Path.join(path,child)
END WHILE
CALL os.Path.dirclose(handle)
END FUNCTION