[ic] File Manager

Kevin Walsh kevin at cursor.biz
Mon Oct 17 15:51:56 EDT 2005


Davor Ocelic [docelic at mail.inet.hr] wrote:
> I am working on building a "file manager" within Interchange for
> non-admin users.  I am stuck trying to set up a way to "delete" files.
> I have a simple tag that I can't seem to make work, and I get nothing in
> the error log. 
> 
> Here is the tag:
> 
> -------------------------------
> UserTag delete-file Routine <<EOR
> sub {
> 
> my ($row) = @_;
> my $file = $row->{deletefile};
>  unlink($file);
> 
> }
> EOR
> -----------------------------
> 
You have not declared any arguments for your UserTag:

    UserTag delete_file Order name
    UserTag delete_file Routine <<EOR
    sub{
        my $file = shift;
        unlink($file) or die qq{Cannot delete "$file": $!};
    }
    EOR

I didn't add your "$row->{deletefile}" code as I have no idea where
you're getting your $row hashref from, or how you intend to pass it
into the UserTag.

the above can be called as [delete-file name="relative/path/to/file"]

Paths should be relative from your catalog home - not absolute from the
filesystem root.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/



More information about the interchange-users mailing list