strange results from dir()
- Posted by Juergen Luethje <eu.lue at gmx.de> Dec 23, 2002
- 531 views
Hello all, running the following program (Win 98, DOS 7.1, Eu 2.3) I get strange results with ex.exe on plain DOS and on a DOS box, and also with exw.exe. --------------------------------------------------------------->8---- Program ----==---------------------------------------------------------==---- include file.e include get.e sequence s object list -- filespecs containing wildcard and trailing backslash s = {"c:\\not_there*\\", "c:\\wind*\\", "c:\\wi?do\\"} for i = 1 to length(s) do list = dir(s[i]) printf(1, "dir(\"%s\"):\n", {s[i]}) if atom(list) then ? list else for k = 1 to length(list) do printf(1, " '%s'\n", {list[k][D_NAME]}) end for end if puts(1, '\n') end for puts(2, "Press any key ...") if wait_key() then end if --------------------------------------------------------------->8---- --------------------------------------------------------------->8---- Output with ex.exe on plain DOS ----==---------------------------------------------------------==---- dir("c:\not_there*\"): 'G' dir("c:\wind*\"): 'H' dir("c:\wi?do\"): 'G' --------------------------------------------------------------->8---- --------------------------------------------------------------->8---- Output with ex.exe on a DOS box ----==---------------------------------------------------------==---- dir("c:\not_there*\"): '6ƒ6ƒ' dir("c:\wind*\"): '7ƒ6ƒ' dir("c:\wi?do\"): '6ƒ6ƒ' --------------------------------------------------------------->8---- --------------------------------------------------------------->8---- Output with exw.exe (!!) ----==---------------------------------------------------------==---- dir("c:\not_there*\"): ' '0' get_ch() end while else return {GET_FAIL, 0} -- no exponent end if e_mag *= e_sign if e_mag > 308 then -- rare case: avoid power() overflow mantissa *= power(10, 308) if e_mag > 1000 then e_mag' dir("c:\wind*\"): '() return Get() end function global function prompt_number(sequence prompt, sequence range) -- Prompt the user to enter a number. -- A range of allowed values may be specified. object answer while 1 do puts(1, prompt) answer = gets(0) ' dir("c:\wi?do\"): '' --------------------------------------------------------------->8---- Can anybody reproduce this? My function lfn_dir() returns -1 in all cases. Is that OK, or what is the expected result? Regards, Juergen -- /"\ ASCII ribbon | while not asleep do \ / campain against | sheep += 1 X HTML e-mail and | end while / \ news |