ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 10th, 2003, 09:15 AM
williamcrawley williamcrawley is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: uk
Posts: 91 williamcrawley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Question FSO Not Working

Hi All,

In my serverside script I have gone down to the bare bones and the following doesn't seem to work:

dim fs
dim fst
dim LineOut
set fs = Server.CreateObject"Scripting.FileSystemObject")
set fst = fs.CreateTextFile("C:\TEMP\home.tmp",True)

lineout = "MAFFIdentifier" & vbtab & "Title" & vbtab & "Initials"
fst.writeline(lineout)
lineout = " ==================================================
========"
fst.writeline(LineOut)

fst.close
set fs = nothing

The server gets to the end since I place a response.write in to test.

If I cut and past this into VB declare the variables as objects and lineout as string and remove the "Server." from the line when setting fs, then it works fine in VB.

Thanks
Bill

Reply With Quote
  #2  
Old November 10th, 2003, 09:31 AM
DarrellMe DarrellMe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Birmingham, England
Posts: 7 DarrellMe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Hi

Do you have any on error resume next statements in your asp code

The one thing that I noticed was that you were missing a bracket from the server.createobject line of code, but I assume that this was a typo

The following code worked on mine

<%
dim fs
dim fst
dim LineOut
set fs = Server.CreateObject("Scripting.FileSystemObject")
set fst = fs.CreateTextFile("C:\TEMP\home.txt",True)
lineout = "MAFFIdentifier" & vbtab & "Title" & vbtab & "Initials"
fst.writeline(lineout)
lineout = "=========================================================="
fst.writeline(LineOut)
fst.close
set fs = nothing

%>

The only thing that I had a problem with initially was the permissions on the TEMP directory, so make sure that the IUSR account has the relevant permissions.

I hope this helps

Darrell

Reply With Quote
  #3  
Old November 10th, 2003, 09:38 AM
williamcrawley williamcrawley is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: uk
Posts: 91 williamcrawley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Hi Darrell,

Yes the Bracket was a typo, I have it in my code. I havn't tested the IUSR permissions, how do I do that?

Thanks
Bill

Reply With Quote
  #4  
Old November 10th, 2003, 01:05 PM
DarrellMe DarrellMe is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Birmingham, England
Posts: 7 DarrellMe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Basically right-click on the folder in windows explorer, and select properties. Then, click on the security tab. This will give you a box with a list of users that have access to the directory. I think that the c:\temp directory only has the administrators group as having full control, which means that the IUSR account will not have access. (however I could be wrong). If you only have the administrators in this box, then click on the add button, and you should be able to add the relevant users to the permissions

Let me know if you need any more help

Darrell

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > FSO Not Working


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT