Hi,
I have a few minor STREAM issues I'd like to post for resolution in a future release. The problems exist in both versions 3.3 and 3.4.
The tests were on Windows XP or Redhat Linux.
1) WINDOWS ONLY: 'query exists' does not work if a system slash is present at the end of the given path. Example:
say stream("c:\regina34\", 'c', 'query exists')
returns NULL, while
say stream("c:\regina34", 'c', 'query exists')
works as expected. It works as expected with or without a trailing '/' on Linux.
2) LINUX ONLY: 'query exists' does not recognize a tilde:
say stream("~/bin", 'c', 'query exists')
returns NULL, while
ls ~/bin
shows that it's there. The issue is N/A Windows.
3) WIN AND LIN: 'executable' returns true (1) for pretty much everything - directory names, text files, etc. For Linux it appears to be simply inspecting the permissions for the file - an insufficient test.
It would be far better for it to run the equivalent of a test -x on Unix/Linux. For Windows, there is an excellent overview on detecting whether a file is executable at http://www.delphidabbler.com/articles?article=8
Thanks,
Chris
The trailing backslash issue has been fixed for Windows.
However, handling for tilde as replacement for $HOME on Linux is still open as of v3.9.4.
I hoped the fix for #511 would also have fixed this, but the issue is still present.
Linux stream(file, 'c', 'executable') matches test -x results, so I consider it fixed. (But I disagree with apparent Unix community acceptance that "permission to execute" is the same as "when I type a filename into a prompt, something other than 'command not found' is presented as a result".)
However, stream(file, 'c', 'executable') aborts in Windows for versions 3.9.1 and 3.9.4!
Item 2) tilde now recognised as $HOME replacement