[thelist] ASP FileSystemObject

Chris Marsh chrism at puffofsmoke.net
Wed Jan 30 12:35:10 CST 2002


Howard

> I don't think objTextStream.WriteIn is a method. Use Write() or
> WriteLine()
> instead.

My bad :( However, I don't believe this is causing the problem, as in the
actual code I have this line commented out. By merely including the
following line, the problem occurs:

Set objTF = objFSO.CreateTextFile(strPath)

The value for strPath is valid, as a) I have checked it, and b) the test for
the the file at this location works whether the file is there or not (as
long as the above line of code is not present in the statement).

Thanks for your assistance.

> At 06:01 PM 1/30/2002 +0000, Chris Marsh wrote:
> ><%
> >Dim objFSO
> >Dim objTF
> >Dim strPath
> >
> >Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
> >strPath = Server.MapPath(Application("strPath")) & "\news\docs\copy.txt"
> >
> >'-- Check for existence of text document
> >If objFSO.FileExists(strPath) = false Then
> >         Response.Write "Does Not Exist<br><br>" & strPath
> >
> >'-- Create file
> >         Set objTF = objFSO.CreateTextFile(strPath)
> >         objTF.WriteIn "Hello World"
> >         objTF.Close
> >Else
> >         Response.Write "Does Exist<br><br>" & strPath
> >End If
> >%>
>
> ::::::::::::::::::::::
> Howard Cheng
> howcheng at ix.netcom.com
> AIM: bennyphoebe
> ICQ: 47319315
>
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !
>




More information about the thelist mailing list