Artifacts Associated With Ticket 560c5e438c47f5fd
Ticket change [4f6c543230] (rid 190704) by emiliano on 2021-01-05 16:14:16:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
[file stat] uses and old interface which requires to pass a variable name to use as an array to return the result. This is problematic for two reasons * If this information is meant to be passed around to procs, the usual [array get]/[array set] is needed. * It pollutes the variable namespace for no additional benefit. Nowadays dictionaries are a more natural data structure to return such information. This RFE proposes to modify [file stat] such that passing the variable name is optional, returning a dictionary otherwise. Attached patch implements such behaviour. Note that tests cmdAH-28.1 and cmdAH-28.2 are affected by this change. The patch address this issue as well.
- foundin initialized to: "8.7"
- is_private initialized to: "0"
- login: "emiliano"
- priority initialized to: "5 Medium"
- private_contact initialized to: "885ae311f5fce05c2a8d9c31d2d2a1b5638ca9df"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "emiliano"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "modernize [file stat] interface"
- type initialized to: "RFE"
Add attachment "filestat.diff" [ad562d8fae] (rid 190705) by emiliano on 2021-01-05 16:15:23.
Ticket change [75566b8608] (rid 190997) by aspect on 2021-01-13 03:07:26:
- comment changed to:
This change makes the `varName` argument to [file stat] optional, introducing a 1-argument form. The 2-argument form is unchanged. The new 1-argument form produces the same errors, but on success returns its result as a dictionary instead of populating an array in the caller's namespace. The dictionary result is identical with what would be stored in the array. Calling [file stat] with one argument previously raised a {TCL WRONGARGS} error, so this change can be considered backward-compatible. Returning a dictionary is beneficial in that it can be passed & returned by value between procs, it can be processed by [dict] commands and the caller has full control over whether and how to store it in a variable. Attached patch implements such behaviour. Note that tests cmdAH-28.1 and cmdAH-28.2 are affected by this change. The patch address this issue as well. - login: "aspect"
- mimetype: "text/plain"
- comment changed to:
Ticket change [9d97adc606] (rid 190998) by oehhar on 2021-01-13 08:23:30:
- icomment:
Emiliano, I appreciate your great contribution. As it is a user visible change, a TIP is required. If you don't have commit rights to core.tcl-lang.org/tips , please ask for it to drive the process. Thank you, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [e74e037b6e] (rid 191011) by aspect on 2021-01-13 12:26:39:
- icomment:
https://core.tcl-lang.org/tips/doc/trunk/tip/594.md Listed Emiliano as primary author since he contributed the idea and the patch. Any errors in the tip text are mine.
- login: "aspect"
- mimetype: "text/plain"
- icomment:
Ticket change [867ff87788] (rid 191043) by dkf on 2021-01-14 10:00:34:
- icomment: "Looks like a good change to me."
- login: "dkf"
- mimetype: "text/html"
Delete attachment "filestat.diff" [4f4b57d8a2] (rid 191046) by emiliano on 2021-01-14 14:39:33.
Add attachment "filestat.diff" [9c97f2bd33] (rid 191047) by emiliano on 2021-01-14 14:45:55.
Ticket change [c96c423f69] (rid 191048) by emiliano on 2021-01-14 14:58:49:
- icomment:
Added a new patch with the same changes for [file lstat]. Both commands share semantics and implementation, so it seems to me incomplete to implement the change for one and leave the other as is. TIP 594 should be updted to reflect this change.
- login: "emiliano"
- mimetype: "text/plain"
- icomment:
Ticket change [09fb63283f] (rid 216369) by emiliano on 2023-07-11 12:48:11:
- closedate changed to: "2460137.03346138"
- closer changed to: "emiliano"
- icomment: "TIP 594 accepted. It will be available on 8.7"
- login: "emiliano"
- mimetype: "text/plain"
- resolution changed to: "Accepted"
- status changed to: "Closed"