scripter73
Programmer
Hi,
I'm writing a small asp script to read the contents of a text file from a mapped drive to my server.
I'm working with alot of FileSystemObject properties. When I ask if the DriveExists, it does. However, I cannot access my file (that does indeed exist on the server) because my drive is not ready for read/write (I discovered this while performing the IsReady method on my Drive Object.
Is this a server security issue concerning the drive? I'm not a network/system admin, so I don't know if this is something that I'm able to program.
Any help that anyone has on this would be very much appreciated. I sort of a newbie to ASP and I heard that reading/writing text files were easy.
Below is a snippet of my code:
<html>
<head><title>Read Records From Access Log File</title></head>
<body>
<br><br>
<%
dim LogFile, LogFileObj
'Read from a text file
LogFile = "f:\inetpub\ DriveDir = "f:\"
FolderDir = "f:\InetPub\
Set LogFileObj = Server.CreateObject("Scripting.FileSystemObject"
IF LogFileObj.FileExists(LogFile) THEN
response.write "file exists" & "<br>" 'debug line
Set LogTextFile = LogFileObj.OpenTextFile(LogFile)
'read a line of text file
WHILE NOT LogTextFile.AtEndOfStream
%>
<HR>
<%=LogTextFile.Readline%>
</HR>
<%
WEND
ELSE response.write "file does not exist" & "<br>"
'Close the textfile
'LogTextFile.Close
END IF'Does file exist
%>
<HR>
</font>
</body>
</html>
Thanks,
scripter73
I'm writing a small asp script to read the contents of a text file from a mapped drive to my server.
I'm working with alot of FileSystemObject properties. When I ask if the DriveExists, it does. However, I cannot access my file (that does indeed exist on the server) because my drive is not ready for read/write (I discovered this while performing the IsReady method on my Drive Object.
Is this a server security issue concerning the drive? I'm not a network/system admin, so I don't know if this is something that I'm able to program.
Any help that anyone has on this would be very much appreciated. I sort of a newbie to ASP and I heard that reading/writing text files were easy.
Below is a snippet of my code:
<html>
<head><title>Read Records From Access Log File</title></head>
<body>
<br><br>
<%
dim LogFile, LogFileObj
'Read from a text file
LogFile = "f:\inetpub\ DriveDir = "f:\"
FolderDir = "f:\InetPub\
Set LogFileObj = Server.CreateObject("Scripting.FileSystemObject"
IF LogFileObj.FileExists(LogFile) THEN
response.write "file exists" & "<br>" 'debug line
Set LogTextFile = LogFileObj.OpenTextFile(LogFile)
'read a line of text file
WHILE NOT LogTextFile.AtEndOfStream
%>
<HR>
<%=LogTextFile.Readline%>
</HR>
<%
WEND
ELSE response.write "file does not exist" & "<br>"
'Close the textfile
'LogTextFile.Close
END IF'Does file exist
%>
<HR>
</font>
</body>
</html>
Thanks,
scripter73