Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 13th, 2003, 07:15 PM
Authorized User
 
Join Date: Jun 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default fileSystemObject Problem

Hi guys,

I've been having difficulty with creating and deleting a file through ASP and I wondered if anyone here could help guide me.

Here's my code so far

Code:
Dim tempFileName
tempFileName = "joy.txt"

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")

objFSO.createtextfile(tempFileName)

Set objFSO = Nothing
I don't get any errors with this but I don't get any file!

I'm running this file from an internal server on our network, that's mapped to 'MY' P: although I think the file is held on the 'SERVERS' C:, when I run a search for the file I can't find it anywhere, it's just not getting created I guess. Has anyone come across this before?

Any help would be appreciated.

Blaise.
 
Old August 13th, 2003, 07:36 PM
Authorized User
 
Join Date: Jun 2003
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ok, I've managed to ge that working for me, I found out that it was writing to the C: and that I had been looking at the D: instead, Doh!

I've another related question however, is there a way I can find out the current drive path, and have that in a variable, something like Response.Write(server.MapServerPath) = "c:/inetpub/wwwroot/"

TIA

Blaise.
 
Old August 13th, 2003, 08:08 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Blaise,

If you put a folder name into the server.mappath statement below which is in the WWWRoot it will return the physical address of that folder:

strPath = Server.MapPath("/yourFolderName")

to find the folder you are in:

strPath = Server.MapPath("./")

etc.

Rod

======================================
They say, best men are moulded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================





Similar Threads
Thread Thread Starter Forum Replies Last Post
FileSystemObject not available mega Classic ASP Professional 1 June 19th, 2006 10:25 AM
Need Help about FileSystemObject vbpratap VB.NET 0 March 3rd, 2006 06:40 AM
Using the FileSystemObject malhyp Dreamweaver (all versions) 1 October 2nd, 2005 07:00 AM
I need help with FileSystemObject ... PLEASE xanderxvr Classic ASP Professional 0 January 31st, 2005 02:56 AM
FileSystemObject problem... swampwrecker Classic ASP Basics 2 October 12th, 2004 02:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.