REBOL3 tracker
  0.9.12 beta
Ticket #0000606 User: anonymous

Project:



rss
TypeWish Statustested Date6-Feb-2009 20:36
Versionalpha 33 CategoryPorts Submitted byBrianH
PlatformAll Severityminor Priorityurgent

Summary Have QUERY %file/ return info if %file is not a directory.
Description Right now, QUERY returns information about existing directories regardless of whether the file! value has a trailing "/". It would be useful if QUERY of a file (not a directory) would also ignore any trailing "/" in the provided file! value. This would make it easier to determine if the file exists, whether or not it is a directory. This request would only apply to files, not URLs (where the trailing "/" might make the target different).

This is related to #604, and probably the cause of #602 as well. Submitted as a wish in case the current behavior was done intentionally.
Example code
>> query %base
== make object! [
    name: %base/
    size: 0
    date: 14-Jan-2009/21:24:34
    type: 'dir
]
>> query %blah
== make object! [
    name: %blah
    size: 22
    date: 22-Jan-2009/0:16:48
    type: 'file
]
>> query %blah/
== none  ; Should be the same as query %blah

Assigned ton/a Fixed inalpha 99 Last Update8-May-2010 00:23


Comments
(0000412)
BrianH
6-Feb-2009 20:40

This would also make QUERY more R2-compatible, but that is *not* considered important here. If there is a good enough reason to change things from R2, we change things - that is one of the goals of R3.
(0002323)
Carl
6-May-2010 01:08

This was fixed some time ago, but the bug status was not updated.
(0002330)
BrianH
6-May-2010 07:06

The behavior complained about in the example code is still there in alpha 98, *not* fixed. This is how it should behave:
>> query %blah
== make object! [
name: %/path/to/blah
size: 22
date: 22-Jan-2009/0:16:48
type: 'file
]
>> query %blah/
== make object! [
name: %/path/to/blah
size: 22
date: 22-Jan-2009/0:16:48
type: 'file
]
(0002342)
Carl
6-May-2010 17:37

Ah, right. Two different port schemes here. Will look at that.
(0002345)
Carl
6-May-2010 19:31

An oddness in Win32 does not want slash on dir names for GetFileAttributesEx(), so it was erroring out. Fixed.

Date User Field Action Change
8-May-2010 00:23 BrianH Status Modified built => tested
6-May-2010 19:31 carl Comment : 0002345 Added -
6-May-2010 19:30 carl Status Modified reviewed => built
6-May-2010 19:30 carl Fixedin Modified => alpha 99
6-May-2010 17:37 carl Comment : 0002342 Added -
6-May-2010 09:01 BrianH Comment : 0002330 Modified -
6-May-2010 09:00 BrianH Comment : 0002330 Modified -
6-May-2010 09:00 BrianH Status Modified built => reviewed
6-May-2010 09:00 BrianH Fixedin Modified alpha 98 => none
6-May-2010 07:10 BrianH Comment : 0002330 Modified -
6-May-2010 07:08 BrianH Comment : 0002330 Modified -
6-May-2010 07:06 BrianH Comment : 0002330 Added -
6-May-2010 01:08 carl Comment : 0002323 Added -
6-May-2010 01:07 carl Status Modified reviewed => built
6-May-2010 01:07 carl Fixedin Modified => alpha 98
11-Feb-2010 18:11 BrianH Category Modified => Ports
27-Feb-2009 05:20 BrianH Priority Modified normal => urgent
6-Feb-2009 20:40 BrianH Comment : 0000412 Added -
6-Feb-2009 20:36 BrianH Status Modified submitted => reviewed
6-Feb-2009 20:36 BrianH Code Modified -
6-Feb-2009 20:36 BrianH Description Modified -
6-Feb-2009 20:36 BrianH Ticket Added -