|
|
|||||||
Hello all Could someone please help. I am trying to convert the following line of code to use only KiXtart commands as I am trying to get away from using Shell "%ComSpec% commands. Shell "%ComSpec% /c dir N:\ /a-d /b > $tempfile" Thanks in advance Kevin |
||||||||
|
|
|||||||
You could use the KiXtart function Dir(), see the manual for the syntax. For the bare format you could use: code:To be sure that only files are resturned, use:$File=SubStr($File,37) code:You could also get the Pipe() UDF to get the result of your command in am array and loop that array! Search the BB to find Pipe().If (GetFileAttr($File) & 16)<>16 |
||||||||
|
|
|||||||
Kevin ... translate this to : list directories in N:\ non-recursively (/b is irrelevant I think) That'd be then : break on global $folders[0] dim $n $n = dir("n:\") do if getfileattr("n:\" + $n) & 16 ;folder $folders[ubound($folders)] = $n redim preserve $folders[ubound($folders)+1] endif $n = dir() until $n = "" or @error if ubound($folders) redim preserve $folders[ubound($folders)-1] endif "Folders in N:\" ? for each $f in $folders $f ? next get $ |
||||||||
|
|
|||||||
Hello Thanks for the replies. JPols, I am trying to list Non Directories, i.e. only files in N:\ non recursively. Otherwise your script is exactly what I am looking for. Thanks Kevin |
||||||||
|
|
|||||||
for me it looks silver plate just change the folder attribute (16) or do vice versa check: if not getfileattr("n:\" + $n) & 16 ;non folder |
||||||||
|
|
|||||||
yeah ! |
||||||||
|
|
|||||||
See the DirList() - Returns an array with a list of files in a given directory UDF in the UDF Forum. |
||||||||
|
|
|||||||
Hello all Thanks for all the help. I do not think that my brain is in gear at the moment as I forgot about the &16 part. Thanks again Kevin |
||||||||
|
|
|||||||
or the UDF EnumDir() |