MACROMEDIA DREAMWEAVER 8-DREAMWEAVER API Dokumentacja Strona 273

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 692
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 272
The File I/O API 273
Example
The following code checks for a file called mydata.txt and displays an alert box that tells the user
whether the file exists.
var fileURL = "file:///c|/temp/mydata.txt";
if (DWfile.exists(fileURL)){
alert( fileURL + " exists!");
}else{
alert( fileURL + " does not exist.");
}
DWfile.getAttributes()
Availability
Dreamweaver 2
Description
Gets the attributes of the specified file or folder.
Arguments
fileURL
The argument is the file or folder for which you want to get attributes, which is expressed as a
file:// URL.
Returns
A string that represents the attributes of the specified file or folder. If the file or folder does not
exist, this function returns a null value. The following characters in the string represent the
attributes:
R is read only.
D is folder (directory).
H is hidden.
S is system file or folder.
Example
The following code gets the attributes of the mydata.txt file and displays an alert box if the file is
read only.
var fileURL = "file:///c|/temp/mydata.txt";
var str = DWfile.getAttributes(fileURL);
if (str && (str.indexOf("R") != -1)){
alert(fileURL + " is read only!");
}
Przeglądanie stron 272
1 2 ... 268 269 270 271 272 273 274 275 276 277 278 ... 691 692

Komentarze do niniejszej Instrukcji

Brak uwag