Click to See Complete Forum and Search --> : Editing files on the webserver using ASP


Chikara
08-03-2007, 11:43 AM
I have an HTM file on my webserver that is automatically generated by a 3rd party program. Basically this file contains a lot of links.

example


<p><a href="2222.htm">2222</a></p>
<p><a href="2223.htm">2222</a></p>
<p><a href="2224.htm">2222</a></p>


I have a script that looks at the content of each of those htm files(2222.htm, 2223.htm.) If they are blank I want to be able to delete the file from the webserver and remove the link from the master htm file. Deleting the files is no problem. I'm having problems removing the link from the master htm file.

I attempt to open the master.htm file using a textstream. The problem is that I get a bad file mode error when I attempt to read and write things. Any ideas?

buntine
08-03-2007, 11:33 PM
Perhaps show some code snippets?

Most likely the problem is because you are opening the stream for reading only apposed to reading/writing. Take another look at your code where you are explicitely opening the file.

It could be a permissions issue (that would seem odd considering you can delete files without issues, though).

Cheers.

Chikara
08-06-2007, 09:17 AM
Thanks for the response. I talked with a collegue and it seems that VB can only open files to read or write. It can not do both.

Thanks for the help and ideas though.