Child pages
  • cPanel API 1 Functions - Fileman::fmmkfile

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

This function creates a new blank file.


Warning
titleWarning:

Include Page
LIB:_cPanelAPI1NewerFunctions
LIB:_cPanelAPI1NewerFunctions

  • UAPI (recommended)None.
  • cPanel API 2 Fileman::mkfile
    Excerpt Include
    DD:cPanel API 2 Functions - Fileman::mkfile
    DD:cPanel API 2 Functions - Fileman::mkfile
    nopaneltrue

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledFileStorageRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples


Panel
bgColor#FFFFFF
borderStylenone


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$create_file = $cpanel->api1('Fileman', 'fmmkfile', array('public_html', 'myfile', 'pl') ); // Call the function.

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $create_file = $cpliveapi->api1('Fileman', 'fmmkfile' ['public_html', 'myfile', 'pl']); # Call the function.

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink


Expand
titlecPanel Tag System (deprecated)

Include Page
LIB:_cPanelTagsWarning
LIB:_cPanelTagsWarning

Code Block
languagetext
<cpanel Module="Fileman::fmmkfile ( $FORM('dir','newfile','template'))">



Expand
titleCommand Line


Code Block
cpapi1 --user=username Fileman fmmkfile public_html myfile .pl

Include Page
LIB:_cPanelAPI1CLINote
LIB:_cPanelAPI1CLINote


Expand
titleOutput (plaintext)


Code Block
languagetext
Creation of myfile.pl (Perl Script)succeeded.




Parameters

ParameterTypeDescriptionPossible valuesExample
dirstring

Required

The new file's directory.

Any valid directory name on the server.public_html
newfilestring

Required

The new file's name.

A valid filename.myfile
templatestring

Required

The new file's template.

  • .html
  • .pl
  • .sh
  • .txt
.pl

Returns

This function returns a message of success that contains the new file's name.