Page 1 of 1 1
Topic Options
#553 - 1999-10-01 03:28 AM How to find some directors and then
Anonymous
Unregistered


Have you already done this kind of scrpits?
I needed to solver some directors name like
%patp%\tmp*.*
Then I needed to solver are those empty and
if so then delete.

Regards
Jyri

Top
#554 - 1999-10-01 09:23 AM Re: How to find some directors and then
Anonymous
Unregistered


Under vs 3.60, use the Dir() command. You can test the directory first to see if it exists. If it does, then use Dir() to see if any files are in that directory. Is that what you were trying to do? If not, give us some more details.

------------------
Regards,

Brad
Consultant
Net InfraStructure, Inc

Top
#555 - 1999-10-01 10:01 AM Re: How to find some directors and then
Anonymous
Unregistered


Hi Brad and thanks for your answer.
Here is more details.
The problem is that I don't know the name of those temperally folders. They format are TMP????.tmp and I must clarify the name of those four character.
And then I must clarify are they empty, if they are I delete them. If they are not empty, I don't do nothing (only information to log file).
Regards
Jyri

Top
#556 - 1999-10-05 09:04 AM Re: How to find some directors and then
Anonymous
Unregistered


Jyri,

I think it is time you read the manual and run some tests. If I spell out the answer for you, you'll never learn. Go back and look at Dir() again and what you are looking for. Run some tests. It really is very easy.

Regards,

Brad

Top
#557 - 1999-10-06 10:47 AM Re: How to find some directors and then
Anonymous
Unregistered


Here's some code not specific to your problem but gives a general example of the usage of the dir() function
? "Scanning for tagfiles in: $tagfile_directory\" ; slash appended due to root dir bug
$Tagfile = ""

$FileName = Dir("$tagfile_directory\*.tag")
While ($FileName <> "") and (@ERROR = 0)
If $Tagfile = ""
$Tagfile = $Filename
? "Found: $tagfile_directory\$tagfile"
Else
? "Found: $tagfile_directory\$filename"
? "Error: Multiple tagfiles detected, script aborting"
; shell net send mis error message...
$Continue=1
Return
Endif
$Filename = Dir() ; retrieve next file
Loop
If $Tagfile = ""
? "No tagfiles found"
$Continue=1
Return
Endif

------------------
K Torkelson
Sys Admin Analyst
ktorkelson@providentfunding.com


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 709 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.053 seconds in which 0.024 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