469,613 Members | 1,292 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,613 developers. It's quick & easy.

Alternatives to using Scripting.FileSystemObject

Hi,

I've got a freebie hosting mirror of my production personal website
(sounds kinda grandiose, doesn't it?) at http://journeys.webhostme.com/.
At the production website I was using Scripting.FileSystemObject to get
the date that the file was last modified and to read/write a counter
text file for the number of hits that the whole site had. The freebie
has a kind of half-ass*d FileSystemObject, but it has no GetFile method.

Is there any way I can accomplish the same things without using the
FileSystemObject, or by using the crippled one?

TIA
--
Wayfarer
Journeys: http://wayfarer.brinkster.net/contact.asp
Jul 19 '05 #1
3 6289
Wayfarer wrote:
... The freebie has a kind of half-ass*d
FileSystemObject, but it has no GetFile method.

Is there any way I can accomplish the same things without using the
FileSystemObject, or by using the crippled one?


did you ask the host admin/tech-support? seems they might be best placed to
explain what is/isn't available on their servers.

--
William Tasso - http://WilliamTasso.com
Jul 19 '05 #2
What don't you like about the FSO? You could try playing with stdOut
property of the Exec object. (I ~think~ this requires WSH 5.6.). Here's a
sample that may get you started unless I screwed it up, in which case, it'll
just be confusing.

Dim oShell
Dim sPath, sFilename
sPath = "C:\Path\"
sFilename = "file.txt"
Set oShell = CreateObject("WScript.Shell")
Set oExec = oShell.Exec("cmd.exe /c for /f ""tokens=*"" %j in ('dir " &
sPath & sFilename & " /t:a^|find ""/""') do echo %j")
Do While Not oExec.stdOut.AtEndOfStream
sOut = sOut & oExec.StdOut.Read(1)
Loop
Set oExec = Nothing
Set oShell = NOthing
sOut = Replace(sOut, vbCrLf, "|")
aOut = Split(sOut, "|")
If UBound(aOut) > 1 Then sOut = Trim(aOut(2))
sOut = Left(sOut, Len(sOut) - Len(sFilename))

Do while instr(sOut, " ") > 0
sOut = Replace(sOut, " ", " ")
Loop
Dim aProps(2)
aProps(0) = Mid(sOut, 1, Len("MM/DD/YYYY")) 'date modified
aProps(1) = Trim(Mid(sOut, Len("MM/DD/YYYY "), Len("00:00 XM")))
aProps(2) = Right(sOut, Len(sOut) - Len(aProps(0) & aProps(1) & " "))
sResult = "Last modified: " & aProps(0) & " " & aProps(1) & "<br>"
sResult = sResult & "Size (bytes): " & aProps(2)

Response.Write sResult

Ray at home



"Wayfarer" <my*******@bottom.com> wrote in message
news:MP************************@news2.joimail.com. ..
Hi,

I've got a freebie hosting mirror of my production personal website
(sounds kinda grandiose, doesn't it?) at http://journeys.webhostme.com/.
At the production website I was using Scripting.FileSystemObject to get
the date that the file was last modified and to read/write a counter
text file for the number of hits that the whole site had. The freebie
has a kind of half-ass*d FileSystemObject, but it has no GetFile method.

Is there any way I can accomplish the same things without using the
FileSystemObject, or by using the crippled one?

TIA
--
Wayfarer
Journeys: http://wayfarer.brinkster.net/contact.asp

Jul 19 '05 #3
Thus spake William Tasso:
Wayfarer wrote:
... The freebie has a kind of half-ass*d
FileSystemObject, but it has no GetFile method.

Is there any way I can accomplish the same things without using the
FileSystemObject, or by using the crippled one?


did you ask the host admin/tech-support? seems they might be best placed to
explain what is/isn't available on their servers.


I already tried that, thanks. Let's just say that they have proved less
than responsive, proving that you do in fact get what you pay for (like
I said, it's a freebie). I'm stuck with a freebie because I'm probably
going to lose my "production" site at brinkster.com because of lack of
funds. Emailing them (I even emailed their hostmaster listed under
whois) has been like casting words into a great black hole.

--
Wayfarer
Journeys: http://wayfarer.brinkster.net/contact.asp
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Stavros | last post: by
1 post views Thread by Sbroeff | last post: by
7 posts views Thread by Benjamins via AccessMonster.com | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.