473,791 Members | 2,947 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get File Size problem

Ed
Is there any known issue with the use of "Scripting.File SystemObject"?

Here's a snippet of my code to obtain the filesize of a file

Set fso = CreateObject("S cripting.FileSy stemObject")
Set f = fso.Getfile(str FileSpec)
lngFileSize = f.size
Set fso = Nothing

This used to work perfectly. But with the grown of files (now more than
50,000 files), this routine suddenly takes a long time to execute/hang.

Could someone shed some light into this matter?

We have Norton Antivirus installed. But with script blocking OFF.

Thank you.
Jul 19 '05 #1
9 9804
Ed wrote:
Is there any known issue with the use of "Scripting.File SystemObject"?

Here's a snippet of my code to obtain the filesize of a file

Set fso = CreateObject("S cripting.FileSy stemObject")
Set f = fso.Getfile(str FileSpec)
lngFileSize = f.size
Set fso = Nothing

This used to work perfectly. But with the grown of files (now more
than 50,000 files), this routine suddenly takes a long time to
execute/hang.

Could someone shed some light into this matter?

We have Norton Antivirus installed. But with script blocking OFF.

Thank you.


Have you tried this against a smaller folder to verify that the folder size
is the problem?

Norton may still be the problem even though script blocking is off. Try
disabling it completely to see what effect it has.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #2
> Norton may still be the problem even though script blocking is off. Try
disabling it completely to see what effect it has.


Or uninstalling it. Norton is not enough for a server; get a firewall.
Jul 19 '05 #3
"Foo Man Chew" wrote
: > Norton may still be the problem even though script blocking is off. Try
: > disabling it completely to see what effect it has.
:
: Or uninstalling it. Norton is not enough for a server; get a firewall.

Remove your NAV and get a firewall? Which firewall out there works as a
antivirus client for a server?

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.

-Technet Script Center-
http://www.microsoft.com/technet/tre...er/default.asp
-MSDN Library-
http://msdn.microsoft.com/library/default.asp
Jul 19 '05 #4
> Remove your NAV and get a firewall? Which firewall out there works as a
antivirus client for a server?


What is anti-virus protection doing for a server? Unless you're using the
server as a client (e.g. opening e-mail and surfing the web from it), I'd be
more concerned about protecting the server from outside people, than
protecting it from my own stupidity.
Jul 19 '05 #5
Foo Man Chew wrote:
Remove your NAV and get a firewall? Which firewall out there works
as a antivirus client for a server?


What is anti-virus protection doing for a server? Unless you're
using the server as a client (e.g. opening e-mail and surfing the web
from it), I'd be more concerned about protecting the server from
outside people, than protecting it from my own stupidity.


Erm - opening e-mail and surfing the web are not the only way to catch a
virus. Viruses have been around long before there was the internet or email.
Case in point, there was at least one case where a virus was "included" on
the CD containing the installation files for a very well-known program from
a very well-known company.

Anyways, this discussion may be moot - it's not likely to be the OP's
problem ... oh! where did he go?

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #6
"Foo Man Chew" wrote:
: > Remove your NAV and get a firewall? Which firewall out there works as a
: > antivirus client for a server?
:
: What is anti-virus protection doing for a server?
Protecting it from virii/worms, etc.

: Unless you're using the
: server as a client (e.g. opening e-mail and surfing the web from it), I'd
be
: more concerned about protecting the server from outside people, than
: protecting it from my own stupidity.
I don't disagree but he didn't provide his network layout. He may already
have a firewall.

--
Roland

This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose.

-Technet Script Center-
http://www.microsoft.com/technet/tre...er/default.asp
-MSDN Library-
http://msdn.microsoft.com/library/default.asp

Jul 19 '05 #7
Ed
Is there another way to get the filesize of any given file without using
FileSystemObjec t?
"Bob Barrows" <re******@NOyah oo.SPAMcom> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Ed wrote:
Is there any known issue with the use of "Scripting.File SystemObject"?

Here's a snippet of my code to obtain the filesize of a file

Set fso = CreateObject("S cripting.FileSy stemObject")
Set f = fso.Getfile(str FileSpec)
lngFileSize = f.size
Set fso = Nothing

This used to work perfectly. But with the grown of files (now more
than 50,000 files), this routine suddenly takes a long time to
execute/hang.

Could someone shed some light into this matter?

We have Norton Antivirus installed. But with script blocking OFF.

Thank you.
Have you tried this against a smaller folder to verify that the folder

size is the problem?

Norton may still be the problem even though script blocking is off. Try
disabling it completely to see what effect it has.

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 19 '05 #8
Ed wrote:
Is there another way to get the filesize of any given file without
using FileSystemObjec t?

Not without involving API calls, which are best done with a separate
component (a VB dll for example). According to this page,
http://home.att.net/~wshvbs/, it is possible to make API calls from script,
but I haven't tried it.

So have you verified that the folder size is the problem?

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #9
> So have you verified that the folder size is the problem?

FileSystemObjec t shouldn't have any folder size limitations. I just added a
network share to a SAN, hit an ASP page through windows auth, and it had no
problem iterating a folder on the SAN that has over 300,000 files, totalling
nearly 1 TB (with 2.5 TB free on that specific share).

Well, "no problem" should say "a little difficulty," because it wasn't as
quick as I'd expect. But it finished.

I would guess that (if it's not a Norton issue after all) the methodology
itself might be the problem. Rather than iterating through the entire
folder, treating each file individually and using GetFile to obtain a handle
to the file, why not do this:

set fso = CreateObject("S cripting.FileSy stemObject")
set fold = fso.getfolder(" C:\bigfolder\")
for each file in fold.files
response.write file.name & ", " & file.size & "<br>"
next

(You don't need a heavy file object if all you want to do is get the size.)

This is the code I used above. I did not attempt the exact code from the
o.p.
Jul 19 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
23173
by: Sean Ross | last post by:
Hi. Recently I made a small script to do some file transferring (among other things). I wanted to monitor the progress of the file transfer, so I needed to know the size of the files I was transferring. Finding out how to get this information took some time (reading the manuals - googling did not prove worthwhile). Anyway, I did eventually figure out how to do it (there are a few ways, including os.path.getsize(filename)). My...
6
2239
by: Pierre-Benoit | last post by:
Hi there, I've a strange problem with ado.net and an Access db. I need to create a little C# app that take the content of "ole object" field and then save it into a file. The problem is that when I do the following Byte byteBLOBData = new Byte; byteBLOBData = (Byte)(ds.Tables.Rows);
12
695
by: Ken | last post by:
How can I determine a image file size before uploading it? I would like to make sure the size is under a maximum before taking the time to upload it. If I have to upload the file before determining the size, it could take a few minutes (Mbs) on a slow connection before I can determine if the size is too large. Thanks!
49
61190
by: Sam | last post by:
Hi all, Is there a function in the standard library that can get the size of a file? Thank you very much. Sam.
5
3737
by: Jefferis NoSpamme | last post by:
Hi all, I'm trying to limit the file size of an image submission and I keep running into various problems. I've got most of it working, but I'm stumped and I have a basic question as to WHY this works at all! if ($_FILES !="") { if ($_FILES<=0) { header("Location: /fileerror.php"); exit; }
2
5158
by: pmlane2001 | last post by:
I have a PHP SOAP XML file size problem that I was wondering if anyone has seen before. I have an XML file that when I put it through my PHP script with 270 lines (13,082 KB) it works fine. If I make it 271 lines (13,112 KB), it causes the script to end with a soap fault. I've tried adding substance to the 270 lines to make the file bigger with out adding lines, but it didn't fail. I've installed everything on a second development box...
0
1038
by: swathi123 | last post by:
hi all here im trying to create .csv file. my code is public class CSVFile { public static void main(String args) { String record=null; try {
1
1658
by: swathi123 | last post by:
hi all here im trying to create .csv file. my code is public class CSVFile { public static void main(String args) { String record=null; try {
1
3256
by: r3d dra6on | last post by:
I am trying to get the file size of a memory mapped I/O from the input file, and set that size to the output file. Right now the code below is stuck on the kernel mapping for the output. The program is suppose to map an input and an output and transfer all the writing from the input to the output with changes made to a specific ASCII character. The two problems I'm having trouble understanding are how to get the file size of the input to...
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10154
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5430
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.