D
Doug Parker
Hi -
I need to write to a file. I get the "Bad file mode" error when I run the
script below. I understand that this is a permissions issue. Since I'm
working with a shared server, I apparently can't login and change file
permission settings. I called the tech support for the host I'm working
with, and they couldn't figure it out. I can't believe this is so difficult
since the same operation entails a single chmod command in Unix.
Any help would be greatly appreciated...
<!--#include file="fmtDateTime.asp" -->
<%
Set fso = CreateObject("Scripting.FileSystemObject")
Set a = fspenTextFile(Server.MapPath("counter.txt"),2)
line=a.readLine
lines=split(line,"|")
fileDate = lines(0)
counter = lines(1)
curDate = fmtDateTime(Now(), "yyyy-mm-dd")
temp = split(curDate,"-")
y = temp(0)
m = temp(1)
d = temp(2)
if curDate = fileDate then
counter = counter + 1
newDate = fileDate
else
counter = 1
newDate = curDate
end if
Set a = Nothing
Set fso = Nothing
%>
I need to write to a file. I get the "Bad file mode" error when I run the
script below. I understand that this is a permissions issue. Since I'm
working with a shared server, I apparently can't login and change file
permission settings. I called the tech support for the host I'm working
with, and they couldn't figure it out. I can't believe this is so difficult
since the same operation entails a single chmod command in Unix.
Any help would be greatly appreciated...
<!--#include file="fmtDateTime.asp" -->
<%
Set fso = CreateObject("Scripting.FileSystemObject")
Set a = fspenTextFile(Server.MapPath("counter.txt"),2)
line=a.readLine
lines=split(line,"|")
fileDate = lines(0)
counter = lines(1)
curDate = fmtDateTime(Now(), "yyyy-mm-dd")
temp = split(curDate,"-")
y = temp(0)
m = temp(1)
d = temp(2)
if curDate = fileDate then
counter = counter + 1
newDate = fileDate
else
counter = 1
newDate = curDate
end if
Set a = Nothing
Set fso = Nothing
%>