Overview
Comment: | added [file join], [file split] |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
07c2ea91bc6c90eadee982dc6c4b450b |
User & Date: | suchenwi on 2013-11-24 08:24:20 |
Other Links: | manifest | tags |
Context
2013-11-24
| ||
10:21 | factored out infovars, added README.txt Leaf check-in: b0688623ce user: suchenwi tags: trunk | |
08:24 | added [file join], [file split] check-in: 07c2ea91bc user: suchenwi tags: trunk | |
2013-11-23
| ||
21:28 | added several file commands, fixed backslash substitutions check-in: 4f3db7f982 user: suchenwi tags: trunk | |
Changes
Modified tcl053.js from [623beb5ebc] to [dc45822eaf].
︙ | |||
60 61 62 63 64 65 66 | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | - + | this.incrLevel = function() { this.callframe[++this.level] = {}; return this.level; } this.decrLevel = function() { this.callframe[this.level] = null; this.level--; |
︙ | |||
265 266 267 268 269 270 271 | 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 | + - + - + | throw 'key "'+key+'" not known in dictionary'; }); this.registerSubCommand("dict", "keys", function (interp, args) { if(args.length < 2 || args.length > 3) throw 'wrong # args: should be "dict keys dictionary ?globPattern?"'; var dict = args[1].toList(); var pattern = ".*"; if(args.length == 3) |
︙ | |||
394 395 396 397 398 399 400 | 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 | - - + + - - - - - + + + + + + + + + + + + - + - + + + + + + + | return stat.atime.getTime()/1000; }) this.registerSubCommand("file", "dirname", function (interp, args) { this.arity(args, 2); return interp.dirname(args[1].toString()); }); this.dirname = function(p) { // also used in [glob] |
︙ | |||
495 496 497 498 499 500 501 | 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 | - + - + | //interp.buf = ""; //while(interp.buf == "") { //interp.timeout = setTimeout(function(){}, 10000); // if(interp.getsing==0) break; //} return; // result will be in interp.buf when done }); |
︙ |
Modified test_tcljs.tcl from [744eb2cb5e] to [93e8b14455].
︙ | |||
98 99 100 101 102 103 104 105 106 107 108 109 110 111 | 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | + + + + | e.g. {set x -44; expr {-$x}} -> 44 e.g. {expr 1<<3} -> 8 e.g. {file dirname foo/bar/grill} -> foo/bar e.g. {file dirname /foo/bar/grill} -> /foo/bar e.g. {file extension foo.txt} -> .txt e.g. {file extension Makefile} -> "" e.g. {file join a b c} -> a/b/c e.g. {file join a /b c} -> /b/c e.g. {file split a/b/c} -> {a b c} e.g. {file split /a/b/c} -> {/ a b c} e.g. {file tail foo/bar/grill} -> grill set forres "" e.g. {for {set i 0} {$i < 5} {incr i} {append forres $i}; set forres} -> 01234 e.g. {foreach i {a b c d e} {append foreachres $i}; set foreachres} -> abcde e.g. {format %x 255} -> ff |
︙ |