mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
deletefile: move to contrib/deprecated
git-svn-id: https://svn.fhem.de/fhem/trunk@16365 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
c9657b2010
commit
6a7c1de63e
@ -1,46 +0,0 @@
|
||||
# $Id$
|
||||
|
||||
package main;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
sub Deletefile_Initialize($$) {
|
||||
|
||||
$cmds{deletefile} = { Fn => "CommandDeletefile",
|
||||
Hlp=>"[filename],delete file"};
|
||||
}
|
||||
|
||||
sub CommandDeletefile($$)
|
||||
{
|
||||
my ($cl, $param) = @_;
|
||||
return "It is not allowed to delete the configuration file fhem.cfg." if ($param =~ m/fhem.cfg/);
|
||||
|
||||
my $file = FW_fileNameToPath($param);
|
||||
return "File $param not found." unless -f $file;
|
||||
|
||||
eval { unlink $file; };
|
||||
return "Error: $@" if $@;
|
||||
|
||||
return "File $file deleted.";
|
||||
}
|
||||
|
||||
1;
|
||||
|
||||
=pod
|
||||
=item command
|
||||
=begin html
|
||||
|
||||
<a name="deletefile"></a>
|
||||
<h3>deletefile</h3>
|
||||
<ul>
|
||||
<code>deletefile <filename></code><br/>
|
||||
<br/>Delete a file in filesystem.<br/>
|
||||
<br/>
|
||||
<li>File must be listed in "Edit files"</li>
|
||||
<li>File fhem.cfg must not be deleted.</li>
|
||||
<li>Wildcards are not evaluated.</li>
|
||||
</ul>
|
||||
|
||||
=end html
|
||||
|
||||
=cut
|
Loading…
Reference in New Issue
Block a user