Page 1 of 1 1
Topic Options
#15644 - 2002-01-02 08:49 AM Problem with DEL on large files?
Anonymous
Unregistered


Hi,

Have any of you experienced problems using DEL on large files > 70 mb?

If I use the below script on a 71 mb file it doesn't delete the file, but when I use a much smaller file fx. 3 kb it works and the file is deleted.

code:

$ASOLogDir = "\\okprd15\D$\Program Files\ComputerAssociates\ASO\LOG\"
$SourceFile = "arcserve.log"

$ThisYear = SubStr(@Date,Len(@Date)-7,2)
$ThisMonth = SubStr(@Date,Len(@Date)-4,2)
$ThisDay = SubStr(@Date,Len(@Date)-1,2)
$ThisDate = $ThisDay + $ThisMonth + $ThisYear

$TargetFile = "arcserve.log." + $ThisDate

$ErrorNoFile = " doesn't exist"

$Count = 1

If Exist ($ASOLogDir + $SourceFile)
; If Targefile exists increment Count
While Exist ($ASOLogDir + $TargetFile + "-" + $Count)
$Count = $Count + 1
Loop
; Copy file
Copy $ASOLogDir + $SourceFile $ASOLogDir + $TargetFile + "-" + $Count
; Delete file
Del $ASOLogDir + $SourceFile
Else
? $ASOLogDir + $SourceFile + $ErrorNoFile
EndIF


Thanks,
Nicolaj

Top
#15645 - 2002-01-02 03:24 PM Re: Problem with DEL on large files?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
nicolaj,

Give this a shot..

After the line with -

Del $ASOLogDir + $SourceFile

Add a SLEEP statement..

Del $ASOLogDir + $SourceFile
SLEEP 1

Even a second gives this a chance to complete before continuing..

You may need to go up to 5 seconds for such a large file.

HTH,

- Kent

_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#15646 - 2002-01-02 11:45 PM Re: Problem with DEL on large files?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
You could also use another WHILE loop checking the file existence as part of the del, or use a SHELL which "should" wait till completed.
Top
#15647 - 2002-01-03 08:52 AM Re: Problem with DEL on large files?
Anonymous
Unregistered


Hi and thanks for your replies.

I checked this morning and it only seems to be a problem when running the script using a scheduled task in Windows 2000. The user-perm. should be sufficient as the file perm. is set to "everyone full control".

It seems that it copies the file, but never deletes it - even if I use "SLEEP 5" efter the DEL command and a "RETURN" at the end of the script. If I use Windows Task Manager to see what processes that are currently running, the KiXtart process is running and "I/O Reads" and "I/O Writes" just keeps counting up...

Hmmm wait a minute....! I'm looking at it as we speak and the task has just finished and the KiXtart process is gone. It took the script much longer to complete than when running it manually though...strange....

Oh well, thanks for the input!

Best regards,
Nicolaj

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 857 anonymous users online.
Newest Members
JimDunn, fgarcia, Viginette, ManuvdWielNL, Sir_Barrington
17890 Registered Users

Generated in 0.066 seconds in which 0.033 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org