Connecting Tech Pros Worldwide Help | Site Map

File.exists

  #1  
Old July 20th, 2005, 03:29 PM
Aaron
Guest
 
Posts: n/a
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/...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
  #2  
Old July 20th, 2005, 03:30 PM
Jeff North
Guest
 
Posts: n/a

re: File.exists


On 12 Feb 2004 13:28:07 -0800, in comp.lang.javascript
af@poorstudents.us (Aaron) wrote:
[color=blue]
>| 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/...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[/color]


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/d...displaylang=en


---------------------------------------------------------------
jnorth@yourpantsbigpond.net.au : Remove your pants to reply
---------------------------------------------------------------
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using File.Exists DEWright_CA@online.nospam answers 4 November 19th, 2005 03:57 PM
How to use File.Exists and Handle Insufficient Permissions Chris Fink answers 2 November 17th, 2005 10:16 AM
System.IO.File.Exists behaves differently when run from a mapped drive Zeno Lee answers 2 November 16th, 2005 06:59 PM
File.Exists question Dan answers 18 November 16th, 2005 11:16 AM
Good way of checking if file exists ? Geiregat Jonas answers 15 November 14th, 2005 01:28 AM