cmdr
Check-in [0be2930b72]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Moved to "mistake". This requires more thought. At issue is that the "recently" made validation types "wchan" and "rwchan" generate externally visible changes as part of their creation of the internal representation. Namely, they create a file. This is problematic as in some situations the VT is called on to simply check if the input is ok, and nothing more. And while the code path in question does call on the "release" method of the VT to cleanup the internal rep the external side-effect remains. The change here went with extending "release" to allow it to undo the external effect as well, on request. This then requires determining when to do that, and when not. And that is difficult as the same APIs are used internally and given to the user. A better path might be to change the VT API. For compatibility we cannot change "validate", it has to keep doing validation + conversion. New methods would be required for each of the two parts. Then the framework can defer the creation of the int. rep until the last possible moment, i.e. when the user needs it. While the other places only requiring validation limit themselves to that, and no side-effects, in- or outside of memory. ---- Extended the std validation types to support an undo flag for their release method.
Timelines: family | ancestors | mistake
Files: files | file ages | folders
SHA1: 0be2930b72424a4ce05bbb5b2bc1c31b6e2610ec
User & Date: andreask 2014-05-16 00:46:09
Original Comment: Extended the std validation types to support an undo flag for their release method.
Context
2014-05-16
00:46
Moved to "mistake". This requires more thought. At issue is that the "recently" made validation types "wchan" and "rwchan" generate externally visible changes as part of their creation of the internal representation. Namely, they create a file. This is problematic as in some situations the VT is called on to simply check if the input is ok, and nothing more. And while the code path in question does call on the "release" method of the VT to cleanup the internal rep the external side-effect remains. The change here went with extending "release" to allow it to undo the external effect as well, on request. This then requires determining when to do that, and when not. And that is difficult as the same APIs are used internally and given to the user. A better path might be to change the VT API. For compatibility we cannot change "validate", it has to keep doing validation + conversion. New methods would be required for each of the two parts. Then the framework can defer the creation of the int. rep until the last possible moment, i.e. when the user needs it. While the other places only requiring validation limit themselves to that, and no side-effects, in- or outside of memory. ---- Extended the std validation types to support an undo flag for their release method. Closed-Leaf check-in: 0be2930b72 user: andreask tags: mistake
00:44
Fix inadvertent split of trunk check-in: 8ff369076f user: andreask tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to validate.tcl.

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
...
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
...
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
...
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
...
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
...
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
...
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
...
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
...
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
...
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
...
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
...
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
...
469
470
471
472
473
474
475
476
477

478
479
480
481
482
483
484
...
508
509
510
511
512
513
514
515



516
517
518
519
520
521
522
...
535
536
537
538
539
540
541
542
543
namespace eval ::cmdr::validate::boolean {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-enum
}

proc ::cmdr::validate::boolean::release  {p x} { return }
proc ::cmdr::validate::boolean::default  {p}  {
    debug.cmdr/validate {}
    return no
}

proc ::cmdr::validate::boolean::complete {p x} {
    debug.cmdr/validate {} 10
    return [complete-enum {yes no false true on off 0 1} 1 $x]
................................................................................

namespace eval ::cmdr::validate::integer {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
}

proc ::cmdr::validate::integer::release  {p x} { return }
proc ::cmdr::validate::integer::default  {p}  {
    debug.cmdr/validate {}
    return 0
}
proc ::cmdr::validate::integer::complete {p x} {
    debug.cmdr/validate {} 10
    return {}
}
................................................................................

namespace eval ::cmdr::validate::double {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
}

proc ::cmdr::validate::double::release  {p x} { return }
proc ::cmdr::validate::double::default  {p}  {
    debug.cmdr/validate {}
    return 0
}
proc ::cmdr::validate::double::complete {p x} {
    debug.cmdr/validate {} 10
    return {}
}
................................................................................

namespace eval ::cmdr::validate::percent {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
}

proc ::cmdr::validate::percent::release  {p x} { return }
proc ::cmdr::validate::percent::default  {p}  {
    debug.cmdr/validate {}
    return 0
}
proc ::cmdr::validate::percent::complete {p x} {
    debug.cmdr/validate {} 10
    return {}
}
................................................................................
## Any string

namespace eval ::cmdr::validate::identity {
    namespace export default validate complete release
    namespace ensemble create
}

proc ::cmdr::validate::identity::release  {p x} { return }
proc ::cmdr::validate::identity::default  {p}   { debug.cmdr/validate {}    ; return {} }
proc ::cmdr::validate::identity::complete {p x} { debug.cmdr/validate {} 10 ; return {} }
proc ::cmdr::validate::identity::validate {p x} { debug.cmdr/validate {}    ; return $x }

# # ## ### ##### ######## ############# #####################
## Any string, alternate name

namespace eval ::cmdr::validate::pass {
    namespace export default validate complete release
    namespace ensemble create
}

proc ::cmdr::validate::pass::release  {p x} { return }
proc ::cmdr::validate::pass::default  {p}   {debug.cmdr/validate {}    ; return {} }
proc ::cmdr::validate::pass::complete {p x} {debug.cmdr/validate {} 10 ; return {} }
proc ::cmdr::validate::pass::validate {p x} {debug.cmdr/validate {}    ; return $x }

# # ## ### ##### ######## ############# #####################
## Any string, alternate name, the second

namespace eval ::cmdr::validate::str {
    namespace export default validate complete release
    namespace ensemble create
}

proc ::cmdr::validate::str::release  {p x} { return }
proc ::cmdr::validate::str::default  {p}   { debug.cmdr/validate {}    ; return {} }
proc ::cmdr::validate::str::complete {p x} { debug.cmdr/validate {} 10 ; return {} }
proc ::cmdr::validate::str::validate {p x} { debug.cmdr/validate {}    ; return $x }

# # ## ### ##### ######## ############# #####################
## File, existing and readable

................................................................................
namespace eval ::cmdr::validate::rfile {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
}

proc ::cmdr::validate::rfile::release  {p x} { return }
proc ::cmdr::validate::rfile::default  {p}   { return {} }
proc ::cmdr::validate::rfile::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rfile::Ok $x
}
proc ::cmdr::validate::rfile::validate {p x} {
    debug.cmdr/validate {}
................................................................................
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
    namespace import ::cmdr::validate::common::ok-directory
}

proc ::cmdr::validate::wfile::release  {p x} { return }
proc ::cmdr::validate::wfile::default  {p}   { return {} }
proc ::cmdr::validate::wfile::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::wfile::Ok $x
}
proc ::cmdr::validate::wfile::validate {p x} {
    debug.cmdr/validate {}
................................................................................
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
    namespace import ::cmdr::validate::common::ok-directory
}

proc ::cmdr::validate::rwfile::release  {p x} { return }
proc ::cmdr::validate::rwfile::default  {p}   { return {} }
proc ::cmdr::validate::rwfile::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rwfile::Ok $x
}
proc ::cmdr::validate::rwfile::validate {p x} {
    debug.cmdr/validate {}
................................................................................
namespace eval ::cmdr::validate::rdirectory {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
}

proc ::cmdr::validate::rdirectory::release  {p x} { return }
proc ::cmdr::validate::rdirectory::default  {p}   { return {} }
proc ::cmdr::validate::rdirectory::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rdirectory::Ok $x
}

proc ::cmdr::validate::rdirectory::validate {p x} {
................................................................................
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
    namespace import ::cmdr::validate::common::ok-directory
}

proc ::cmdr::validate::rwdirectory::release  {p x} { return }
proc ::cmdr::validate::rwdirectory::default  {p}   { return {} }
proc ::cmdr::validate::rwdirectory::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rwdirectory::Ok $x
}

proc ::cmdr::validate::rwdirectory::validate {p x} {
................................................................................
namespace eval ::cmdr::validate::rpath {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
}

proc ::cmdr::validate::rpath::release  {p x} { return }
proc ::cmdr::validate::rpath::default  {p}   { return {} }
proc ::cmdr::validate::rpath::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rpath::Ok $x
}

proc ::cmdr::validate::rpath::validate {p x} {
................................................................................
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
    namespace import ::cmdr::validate::common::ok-directory
}

proc ::cmdr::validate::rwpath::release  {p x} { return }
proc ::cmdr::validate::rwpath::default  {p}   { return {} }
proc ::cmdr::validate::rwpath::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rwpath::Ok $x
}

proc ::cmdr::validate::rwpath::validate {p x} {
................................................................................
namespace eval ::cmdr::validate::rchan {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
}

proc ::cmdr::validate::rchan::release  {p x} {
    if {$x eq "stdin"} return
    close $x
    return
}
proc ::cmdr::validate::rchan::default  {p}   { return stdin }
proc ::cmdr::validate::rchan::complete {p x} {
    debug.cmdr/validate {} 10
................................................................................
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
    namespace import ::cmdr::validate::common::ok-directory
}

proc ::cmdr::validate::wchan::release  {p x} {
    if {$x eq "stdout"} return

    close $x
    return
}
proc ::cmdr::validate::wchan::default  {p}   { return stdout }
proc ::cmdr::validate::wchan::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::wchan::Ok $x
................................................................................
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
    namespace import ::cmdr::validate::common::ok-directory
}

proc ::cmdr::validate::rwchan::release  {p x} { close $x }



proc ::cmdr::validate::rwchan::default  {p}   { return {} }
proc ::cmdr::validate::rwchan::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rwchan::Ok $x
}
proc ::cmdr::validate::rwchan::validate {p x} {
    debug.cmdr/validate {}
................................................................................
    if {![file readable $path]} {return 0}
    if {![file writable $path]} {return 0}
    return 1
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::validate 1.3.1
return






|
|







 







|
|







 







|
|







 







|
|







 







|












|












|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|







 







|

>







 







|
>
>
>







 







|

54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
...
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
...
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
...
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
...
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
...
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
...
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
...
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
...
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
...
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
...
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
...
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
...
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
...
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
...
539
540
541
542
543
544
545
546
547
namespace eval ::cmdr::validate::boolean {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-enum
}

proc ::cmdr::validate::boolean::release {p x {undo 0}} { return }
proc ::cmdr::validate::boolean::default {p}  {
    debug.cmdr/validate {}
    return no
}

proc ::cmdr::validate::boolean::complete {p x} {
    debug.cmdr/validate {} 10
    return [complete-enum {yes no false true on off 0 1} 1 $x]
................................................................................

namespace eval ::cmdr::validate::integer {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
}

proc ::cmdr::validate::integer::release {p x {undo 0}} { return }
proc ::cmdr::validate::integer::default {p}  {
    debug.cmdr/validate {}
    return 0
}
proc ::cmdr::validate::integer::complete {p x} {
    debug.cmdr/validate {} 10
    return {}
}
................................................................................

namespace eval ::cmdr::validate::double {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
}

proc ::cmdr::validate::double::release {p x {undo 0}} { return }
proc ::cmdr::validate::double::default {p}  {
    debug.cmdr/validate {}
    return 0
}
proc ::cmdr::validate::double::complete {p x} {
    debug.cmdr/validate {} 10
    return {}
}
................................................................................

namespace eval ::cmdr::validate::percent {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
}

proc ::cmdr::validate::percent::release {p x {undo 0}} { return }
proc ::cmdr::validate::percent::default {p}  {
    debug.cmdr/validate {}
    return 0
}
proc ::cmdr::validate::percent::complete {p x} {
    debug.cmdr/validate {} 10
    return {}
}
................................................................................
## Any string

namespace eval ::cmdr::validate::identity {
    namespace export default validate complete release
    namespace ensemble create
}

proc ::cmdr::validate::identity::release  {p x {undo 0}} { return }
proc ::cmdr::validate::identity::default  {p}   { debug.cmdr/validate {}    ; return {} }
proc ::cmdr::validate::identity::complete {p x} { debug.cmdr/validate {} 10 ; return {} }
proc ::cmdr::validate::identity::validate {p x} { debug.cmdr/validate {}    ; return $x }

# # ## ### ##### ######## ############# #####################
## Any string, alternate name

namespace eval ::cmdr::validate::pass {
    namespace export default validate complete release
    namespace ensemble create
}

proc ::cmdr::validate::pass::release  {p x {undo 0}} { return }
proc ::cmdr::validate::pass::default  {p}   {debug.cmdr/validate {}    ; return {} }
proc ::cmdr::validate::pass::complete {p x} {debug.cmdr/validate {} 10 ; return {} }
proc ::cmdr::validate::pass::validate {p x} {debug.cmdr/validate {}    ; return $x }

# # ## ### ##### ######## ############# #####################
## Any string, alternate name, the second

namespace eval ::cmdr::validate::str {
    namespace export default validate complete release
    namespace ensemble create
}

proc ::cmdr::validate::str::release  {p x {undo 0}} { return }
proc ::cmdr::validate::str::default  {p}   { debug.cmdr/validate {}    ; return {} }
proc ::cmdr::validate::str::complete {p x} { debug.cmdr/validate {} 10 ; return {} }
proc ::cmdr::validate::str::validate {p x} { debug.cmdr/validate {}    ; return $x }

# # ## ### ##### ######## ############# #####################
## File, existing and readable

................................................................................
namespace eval ::cmdr::validate::rfile {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
}

proc ::cmdr::validate::rfile::release  {p x {undo 0}} { return }
proc ::cmdr::validate::rfile::default  {p}   { return {} }
proc ::cmdr::validate::rfile::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rfile::Ok $x
}
proc ::cmdr::validate::rfile::validate {p x} {
    debug.cmdr/validate {}
................................................................................
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
    namespace import ::cmdr::validate::common::ok-directory
}

proc ::cmdr::validate::wfile::release  {p x {undo 0}} { return }
proc ::cmdr::validate::wfile::default  {p}   { return {} }
proc ::cmdr::validate::wfile::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::wfile::Ok $x
}
proc ::cmdr::validate::wfile::validate {p x} {
    debug.cmdr/validate {}
................................................................................
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
    namespace import ::cmdr::validate::common::ok-directory
}

proc ::cmdr::validate::rwfile::release  {p x {undo 0}} { return }
proc ::cmdr::validate::rwfile::default  {p}   { return {} }
proc ::cmdr::validate::rwfile::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rwfile::Ok $x
}
proc ::cmdr::validate::rwfile::validate {p x} {
    debug.cmdr/validate {}
................................................................................
namespace eval ::cmdr::validate::rdirectory {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
}

proc ::cmdr::validate::rdirectory::release  {p x {undo 0}} { return }
proc ::cmdr::validate::rdirectory::default  {p}   { return {} }
proc ::cmdr::validate::rdirectory::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rdirectory::Ok $x
}

proc ::cmdr::validate::rdirectory::validate {p x} {
................................................................................
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
    namespace import ::cmdr::validate::common::ok-directory
}

proc ::cmdr::validate::rwdirectory::release  {p x {undo 0}} { return }
proc ::cmdr::validate::rwdirectory::default  {p}   { return {} }
proc ::cmdr::validate::rwdirectory::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rwdirectory::Ok $x
}

proc ::cmdr::validate::rwdirectory::validate {p x} {
................................................................................
namespace eval ::cmdr::validate::rpath {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
}

proc ::cmdr::validate::rpath::release  {p x {undo 0}} { return }
proc ::cmdr::validate::rpath::default  {p}   { return {} }
proc ::cmdr::validate::rpath::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rpath::Ok $x
}

proc ::cmdr::validate::rpath::validate {p x} {
................................................................................
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
    namespace import ::cmdr::validate::common::ok-directory
}

proc ::cmdr::validate::rwpath::release  {p x {undo 0}} { return }
proc ::cmdr::validate::rwpath::default  {p}   { return {} }
proc ::cmdr::validate::rwpath::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rwpath::Ok $x
}

proc ::cmdr::validate::rwpath::validate {p x} {
................................................................................
namespace eval ::cmdr::validate::rchan {
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
}

proc ::cmdr::validate::rchan::release {p x {undo 0}} {
    if {$x eq "stdin"} return
    close $x
    return
}
proc ::cmdr::validate::rchan::default  {p}   { return stdin }
proc ::cmdr::validate::rchan::complete {p x} {
    debug.cmdr/validate {} 10
................................................................................
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
    namespace import ::cmdr::validate::common::ok-directory
}

proc ::cmdr::validate::wchan::release {p x {undo 0}} {
    if {$x eq "stdout"} return
    if {$undo} { file delete [$p string] }
    close $x
    return
}
proc ::cmdr::validate::wchan::default  {p}   { return stdout }
proc ::cmdr::validate::wchan::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::wchan::Ok $x
................................................................................
    namespace export default validate complete release
    namespace ensemble create
    namespace import ::cmdr::validate::common::fail
    namespace import ::cmdr::validate::common::complete-glob
    namespace import ::cmdr::validate::common::ok-directory
}

proc ::cmdr::validate::rwchan::release {p x {undo 0}} {
    if {$undo} { file delete [$p string] }
    close $x
}
proc ::cmdr::validate::rwchan::default  {p}   { return {} }
proc ::cmdr::validate::rwchan::complete {p x} {
    debug.cmdr/validate {} 10
    complete-glob ::cmdr::validate::rwchan::Ok $x
}
proc ::cmdr::validate::rwchan::validate {p x} {
    debug.cmdr/validate {}
................................................................................
    if {![file readable $path]} {return 0}
    if {![file writable $path]} {return 0}
    return 1
}

# # ## ### ##### ######## ############# #####################
## Ready
package provide cmdr::validate 1.4
return