From 615e4289ec90871791cea6edc70ce6a9d4be4f3c Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Tue, 29 Nov 2011 04:51:36 +0000 Subject: add expand_vars proc to expand vars like /Users/hans, , etc within the file names svn path=/trunk/externals/tclfile/; revision=15802 --- exists.tcl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'exists.tcl') diff --git a/exists.tcl b/exists.tcl index 6533e49..bc10a06 100644 --- a/exists.tcl +++ b/exists.tcl @@ -16,18 +16,19 @@ proc exists::constructor {self args} { # HOT inlet -------------------------------------------------------------------- proc exists::0_symbol {self args} { - variable ${self}::filename [pd::arg 0 symbol] + variable ${self}::filename [tclfile::expand_vars [pd::arg 0 symbol]] exists::0_bang $self } proc exists::0_anything {self args} { - variable ${self}::filename [tclfile::make_symbol $args] + variable ${self}::filename [tclfile::expand_vars [tclfile::make_symbol $args]] exists::0_bang $self } proc exists::0_bang {self} { variable ${self}::current_canvas variable ${self}::filename + pd::post "filename: $filename" if {[file pathtype $filename] eq "absolute"} { pd::outlet $self 0 float [file exists $filename] } else { @@ -38,11 +39,11 @@ proc exists::0_bang {self} { # COLD inlet ------------------------------------------------------------------- proc exists::1_symbol {self args} { - variable ${self}::filename [pd::arg 0 symbol] + variable ${self}::filename [tclfile::expand_vars [pd::arg 0 symbol]] } proc exists::1_anything {self args} { - variable ${self}::filename [tclfile::make_symbol $args] + variable ${self}::filename [tclfile::expand_vars [tclfile::make_symbol $args]] } pd::class exists -- cgit v1.2.1