Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fso.GetFileVersion size limit?

Status
Not open for further replies.

th3maw

Programmer
Feb 16, 2005
26
0
0
GB
Hello

Got a bit of a weird problem.

We are using standard fso.GetFileVersion code in order to get the version number of the latest dll used to create some documents.

We normally loop through the files to get the latest version (and this works fine on all the DLL's). However in the example below I am hard-coding the file name. The error occurs either way.

'**********************************
strName = "Docs_9_12_3_0.dll"

Set fso = CreateObject("Scripting.FileSystemObject")

version_no = fso.GetFileVersion("c:\Inetpub\ & strName & "")

Response.Write version_no

'*********************************

The code works perfectly on any file under 1.8 MB, however as soon as the file is over that size I am unable to get the version information.

This problem only occurs on our live server, on our test server the same code (pointing at the same files) works perfectly.

The two servers are using the same version on windows with all the same service packs.

I have checjed the IIS settings and they seem identical, although I am not really sure what I am looking for.

Does anyone has any suggestions on how to resolve this?

Thanks
 
Code:
Set fso = [b]Server.[/b]CreateObject("Scripting.FileSystemObject")

doesn't sound like that is the problem but it needs to be fixed


____________ signature below ______________
General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Nope that isn't the problem, but thanks for the response.

I am pulling my hair out over this, and cant find any mention of this problems anywhere online.

I am curious why you think it need to be fixed? It isn't an error/problem as far I am am aware. It is an intentional choice taken to avoid unnecessary overheads.

We have tried both though, and code I pasted above (with CreateObject) was originally taken from the microsoft example.
 
unless you are working on the client the correct call to the CreateObject method is Server.CreateObject.

What exactly is the error you are getting?


____________ signature below ______________
General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Hmm ok, I had always been led to believe that the difference between Server.CreateObject and CreateObject was that Server.CreateObject uses MTS to handle the object.

As I did not need to log the event I am just using CreateObject in order to go straight through.

Anyways, that is a whole other topic, I just found it surpising.

I am not getting an error message, the error is that on the larger files no version information is returned.

So....

fso.GetFileVersion("c:\Inetpub\ & strName & "")

.. returns nothing at all (but only on the files larger than 1.8 MB).

As I said in my first post this problem only happens on one server. On other servers (using identical files & code) there is no problem and the version information is returned.
 
Code:
Server.CreateObject uses MTS to handle the object.

very correct but there are far more things to consider. Scope and you will be prone to errors due to support on components. along with a few other concerns that will cause you or the next maintainer problems. You are creating a server COM object thus should be called the proper way

9 time out of 10 when FSO doesn't return something it has to do with permissions. Your constant larger file size does seem interesting and I wouldn't thin kthe buffer would have anything to do with it but you may look that way also


____________ signature below ______________
General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top