File.exists

A

Aaron

A program I am helping to develop uses html to display standard
outputs (tables, text, etc) and java applets for graphs and other user
interactions. The problem is that depending on program flags input
files, certains output data files may or may not exist.

If the output data file does exist, then I would like a link to a page
to display information on that datafile.

If the output data file does not exist, then no link should be
created.

This program, output, and applets are all on the client computer, so
there is no server for server-side scripts. I figured javascript
would be the best way to go, with one issue, the code needs to work on
as many browsers as possbile.

I tried using File.exists as Netscape's Javascript API suggests:

(http://devedge.netscape.com/library/manuals/2001/xpinstall/1.0/File9.html)

but IE does not like File. I have yet to figure out another approach
to accomplishing this. I thought about using an applet to detect the
file, but not with the security restrictions on unsigned applets.

Please help,

Aaron
 
J

Jeff North

On 12 Feb 2004 13:28:07 -0800, in comp.lang.javascript
| A program I am helping to develop uses html to display standard
| outputs (tables, text, etc) and java applets for graphs and other user
| interactions. The problem is that depending on program flags input
| files, certains output data files may or may not exist.
|
| If the output data file does exist, then I would like a link to a page
| to display information on that datafile.
|
| If the output data file does not exist, then no link should be
| created.
|
| This program, output, and applets are all on the client computer, so
| there is no server for server-side scripts. I figured javascript
| would be the best way to go, with one issue, the code needs to work on
| as many browsers as possbile.
|
| I tried using File.exists as Netscape's Javascript API suggests:
|
| (http://devedge.netscape.com/library/manuals/2001/xpinstall/1.0/File9.html)
|
| but IE does not like File. I have yet to figure out another approach
| to accomplishing this. I thought about using an applet to detect the
| file, but not with the security restrictions on unsigned applets.
|
| Please help,
|
| Aaron


Function ReportFileStatus(filespec)
Dim fso, msg
Set fso = CreateObject("Scripting.FileSystemObject")
If (fso.FileExists(filespec)) Then
msg = filespec & " exists."
Else
msg = filespec & " doesn't exist."
End If
ReportFileStatus = msg
End Function

The latest VBScript helpfile can be found at (watch the line wrap):
http://www.microsoft.com/downloads/...43-7E4B-4622-86EB-95A22B832CAA&displaylang=en
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,276
Latest member
Sawatmakal

Latest Threads

Top