<commit_before>;---------------------------------------
; CLi² (Command Line Interface)
; 2013,2014 © breeze/fishbone crew
;---------------------------------------------
; ls/dir - read directory
;---------------------------------------------
_dir		ex	de,hl
		
		ld	a,(hl)
		cp	#00
		jr	z,lsPath

		push	hl
		call	_storePath
		pop	de
		call	_changeDir
		
		cp	#ff
		call	nz,lsPath

		call	_restorePath
		ret

lsPath		ld	a,(lsPathCount)					; path counter
		cp	#00
		jr	nz,lsNotRoot

		call	_pathToRoot
		jr	lsBegin

lsNotRoot	ld	hl,rootSearch
		call	_searchEntry
		jp	z,lsCantReadDir

lsBegin		xor	a
		ld	(lsCount+1),a<commit_msg>FIX: dir/ls - wrong message if directory is not found!<commit_after>;---------------------------------------
; CLi² (Command Line Interface)
; 2013,2016 © breeze/fishbone crew
;---------------------------------------------
; ls/dir - read directory
;---------------------------------------------
_dir		ex	de,hl
		
		ld	a,(hl)
		cp	#00
		jr	z,lsPath

		push	hl
		call	_storePath
		pop	de
		call	_changeDir
		
		cp	#ff
		jr	nz,lsPath
		
		ld	hl,dirNotFoundMsg
		ld	b,#ff
		call	_printErrorString
		xor	a

lsExit		call	_restorePath
		ret

lsChanged	call	lsPath
		jr	lsExit

lsPath		ld	a,(lsPathCount)					; path counter
		cp	#00
		jr	nz,lsNotRoot

		call	_pathToRoot
		jr	lsBegin

lsNotRoot	ld	hl,rootSearch
		call	_searchEntry
		jp	z,lsCantReadDir

lsBegin		xor	a
		ld	(lsCount+1),a
{'fraction_non_alphanumeric': 0.23900709219858157, 'fraction_numerical': 0.018439716312056736, 'mean_word_length': 1.5795246800731262, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7514101', 'n_tokens_mistral': 612, 'n_tokens_neox': 513, 'n_words': 143}