EasyManua.ls Logo

MACROMEDIA DREAMWEAVER 8-DREAMWEAVER API - Page 25

MACROMEDIA DREAMWEAVER 8-DREAMWEAVER API
628 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
The File I/O API 25
DWfile.remove()
Availability
Dreamweaver 3.
Description
This function deletes the specified file.
Arguments
fileURL
■ The fileURL argument, which is expressed as a file:// URL, is the file you want to
remove.
Returns
A Boolean value: true value if the operation succeeds; false otherwise.
Example
The following example uses the DWfile.getAttributes() function to determine whether
the file is read-only and the
confirm() function to display a Yes/No dialog box to the user:
function deleteFile(){
var delAnyway = false;
var selIndex = document.theForm.menu.selectedIndex;
var selFile = document.theForm.menu.options[selIndex].value;
if (DWfile.getAttributes(selFile).indexOf('R') != -1){
delAnyway = confirm('This file is read-only. Delete anyway?');
if (delAnyway){
DWfile.remove(selFile);
}
}
}
DWfile.setAttributes()
Availability
Dreamweaver MX.
Description
This function sets the system-level attributes of a particular file.
000_DW_API_Print.book Page 25 Wednesday, July 20, 2005 11:58 AM

Table of Contents