Gossamer Forum
Home : General : Perl Programming :

Why won't this delete work?

Quote Reply
Why won't this delete work?
Man, this is really getting on my nerves. I just can't figure out why the .html template is not being deleted, as it should be :(

Code:
system("rm -f $CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/data_import_front.html");

...also tried;

Code:
`rm -f $CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/data_import_front.html`;

... but neither of them seem to delete the file? Is there any built in Apache feature which will let me delete? I tend not to use it really... but in this instance, I really do need it Unimpressed

TIA for any replies.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Why won't this delete work? In reply to
Also, just tried using GT::File::Tools::del, but that didn't work :(

Code:
my @del_files;
$del_files[0] = "$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/data_import_front.html";
GT::File::Tools::del @del_files;

..gives the error;

Quote:
Unable to load install file: Unable to load plugin Data_Import Reason: Install.pm does not compile: syntax error at (eval 5) line 77, near "GT::File::Tools::del @del_files"

Mmmm Unsure

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Why won't this delete work? In reply to
Think I have it now :)

Code:
my @del_files;
$del_files[0] = "$CFG->{admin_root_path}/templates/$CFG->{build_default_tpl}/data_import_front.html";
GT::File::Tools->del(@del_files);

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Why won't this delete work? In reply to
After all that, my original code was working!

Turned out that /admin/templates/default/compiled had a .compiled version of the template in it. I'm guessing that LSQL was just using that, instead of the newley updated version that it should have been using.

I've now added in a delete part for the complied version too, and also 'local' versions, to try and avoid any problems further down the line.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Why won't this delete work? In reply to
Shoulda used error checking ;)