ColdFusion 9.0 Resources |
DirectoryRenameDescriptionRenames on-disk or in-memory directory. CategoryFunction SyntaxDirectoryRename(currentName,newName) UsageEnsure that you have the required permissions to run this function. HistoryColdFusion 9: Added this function Parameters
Example<h2>DirectoryRename Example</h2> <h3>Enter a directory to rename.</h3> <cfform action = "directoryRename.cfm" method="post" preservedata="true" > <label for="renameDirectory">Directory to rename: </label><cfinput required="true" type = "text" id="renameDirectory" name = "renameDirectory"> <br/> <label for="newName">New Name: </label><cfinput required="true" type="text" id="newName" name = "newName"> <br/> <input type = "submit" value="submit" name="submit"> </cfform> <cfif IsDefined("FORM.renameDirectory") and IsDefined("FORM.newName") > <cfif FORM.renameDirectory is not "" and FORM.newName is not ""> <cfset renameDirectory = FORM.renameDirectory> <cfset newName = FORM.newName> <cftry> <cfset DirectoryRename(renameDirectory,newName)> <cfoutput><b>Directory #renameDirectory# renamed to newName</b></cfoutput> <cfcatch> <b>Error Message:</b><cfoutput>#cfcatch.message#</cfoutput><br/> <b>Error Detail:</b><cfoutput>#cfcatch.Detail#</cfoutput> </cfcatch> </cftry> </cfif> </cfif> |