DSTAT on a directory


[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]

Posted by Mike Saunders on May 30, 2007 at 06:35:53:

Came across something, and am looking to gain an understanding.

Though I have not been able to find it documented, I had been working under the assumption that Directory Names (aka LABELS) are always three characters, no spaces before or after.

I came across this code in the dircat03.inc file...
!===================================================================!
! VALIDATE THAT DIRECTORY EXISTS !
!===================================================================!
8220
DIR$ = SUB(DIR$+' ',1,3) ! PAD DIRECTORY NAME
CLOSE (QDIR)
OPEN (QDIR) 'QDIR .DIR' DIR=DIR$
RETURN

I said hmm, directories can be padded with spaces on the right.
So in my code to check user entry for a valid directory, I padded the user entry and then do a dstat on it...
SEARCH.DIRECTORY$ = SUB(SEARCH.DIRECTORY$+' ',1,3) ! STAT$ = DSTAT(SEARCH.DIRECTORY$,EXCPSUB=ERR.GET.SEARCH.DIRECTORY)

During testing I entered some single characters E and S and they correctly found no directories..

Then I tried D and it did not error. Hmm thats weird.
Then I tried C and it did not error. Hmm thats weird.

So I tried this...
STAT$ = DSTAT("D ")
PRINT STAT$
STAT$ = DSTAT("C ")
PRINT STAT$
Both of which returned results...
REL\\RBCCOMET\COMET\REL\ FOR "D "
CL1 09:30:38.05(l FOR "C "

DSTAT CORRECTLY RETURNS E31 FOR "D" AND "C"
DSTAT CORRECTLY RETURNS E31 FOR "D " AND "C "

Anyone have any insights on this?

1) Do Directory Names/LABELS have to be three characters?
2) Are spaces allowed before/after or as middle character?
3) Are Lowercase and/or mixed case Names/Lables allowed?



Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

What is the name of the main Signature System's Product?

Comments:

Optional Link URL:
Link Title:
Optional Image URL:

You may attach up to 5 files to your followup (see below):






[ Follow Ups ] [ Post Followup ] [ Signature.net Forum ]