Norton Allen | 1 Jan 17:36
Picon

Re: [FormBuilder] Current working directory affecting template path?

Steve, How did you specify the template file? If you specified a 
relative path: e.g. template => "foo.html", then it of course depends on 
the CWD. If you specified an absolute path: template => 
"/path/to/foo.html", then it does not depend on the CWD. This is basic 
filesystem stuff.
-Norton

Steve Knoblock wrote:

>I am having trouble with an upload form. I define the form and on
>submitted and valid, process an image, resizing and thumbnailing it.
>In the process, I create hashed directories based on the user id, and
>to create them
>
>cd foo
>mkdir bar
>cd bar
>mkdir baz
>
>like that. But after I come back from this sub, and try to render the
>confirmation page using $form->render() it fails on the template file
>not found. I know the template file is there with correct permissions
>and ownership and have traced the problem to this sub call. The
>confirm page renders before the call and fails after it. The only
>think I can think is C::FB or HTML::Template is depending on the
>original CWD and when I change it, it loses its place.
>
>Should I be saving the CWD and restoring it on return from the sub?
>
>Thanks,
(Continue reading)

Steve Knoblock | 1 Jan 22:34

Re: [FormBuilder] Current working directory affecting template path?

On Mon, 01 Jan 2007 11:36:48 -0500, you wrote:

>Steve, How did you specify the template file? If you specified a 
>relative path: e.g. template => "foo.html", then it of course depends on 
>the CWD. If you specified an absolute path: template => 
>"/path/to/foo.html", then it does not depend on the CWD. This is basic 
>filesystem stuff.

Thanks,
you are right, the template path is relative. For some reason, I
didn't expect changing the current directory to have such a wide
ranging effect.

I will specify the template paths as absolute, which what I intended
in the first place.

Steve

--
Back to our regularly scheduled programming...for(i=0;i<=10;i++) { print i }

_______________________________________________
FBusers mailing list
FBusers <at> formbuilder.org
http://www.formbuilder.org/mailman/listinfo/fbusers


Gmane