Directory's Upper /lower case / Mix case

Directory's Upper /lower case / Mix case

Post by Phil McGuinnes » Sat, 01 Mar 2003 08:52:43



I have noticed some strange behaviour with some directories I create using
VO and my client sites.

Even though I create the Directory as Uppercase.. on some sites this works
on some sites it makes the 1st character Uppercase and the rest lower case
and on one 98 box it make it all lower case.
The same 98 box if you were to supply a name like 'SHERBAC' it would remain
in upper case but it you add one more letter it reverts the lot to lower
case.

The problem on some machines it does not return the full list of
Directories...

Was the code Paul Piko posted on his site to get around this problem of not
returning all directories on some machines..

Damn annoying and very inconsistent.

Phil McGuinness
------

 
 
 

Directory's Upper /lower case / Mix case

Post by Michael Rubinstei » Sat, 01 Mar 2003 12:02:35


    Phil, what happens when you create your directories using lower case?
May be this is the workaround? FP2000 changes the file name to lower case
whenever I add a file.

    Michael


Quote:> I have noticed some strange behaviour with some directories I create using
> VO and my client sites.

> Even though I create the Directory as Uppercase.. on some sites this works
> on some sites it makes the 1st character Uppercase and the rest lower case
> and on one 98 box it make it all lower case.
> The same 98 box if you were to supply a name like 'SHERBAC' it would
remain
> in upper case but it you add one more letter it reverts the lot to lower
> case.

> The problem on some machines it does not return the full list of
> Directories...

> Was the code Paul Piko posted on his site to get around this problem of
not
> returning all directories on some machines..

> Damn annoying and very inconsistent.

> Phil McGuinness
> ------


 
 
 

Directory's Upper /lower case / Mix case

Post by Phil McGuinnes » Sat, 01 Mar 2003 12:27:47


snip[   Phil, what happens when you create your directories using lower
case? ]

They remain lower case..... as far as I know..

snip[ FP2000 changes the file name to lower case whenever I add a file. ]
OK...  does not help me !!

Phil
===


>     Phil, what happens when you create your directories using lower case?
> May be this is the workaround? FP2000 changes the file name to lower case
> whenever I add a file.

>     Michael



> > I have noticed some strange behaviour with some directories I create
using
> > VO and my client sites.

> > Even though I create the Directory as Uppercase.. on some sites this
works
> > on some sites it makes the 1st character Uppercase and the rest lower
case
> > and on one 98 box it make it all lower case.
> > The same 98 box if you were to supply a name like 'SHERBAC' it would
> remain
> > in upper case but it you add one more letter it reverts the lot to lower
> > case.

> > The problem on some machines it does not return the full list of
> > Directories...

> > Was the code Paul Piko posted on his site to get around this problem of
> not
> > returning all directories on some machines..

> > Damn annoying and very inconsistent.

> > Phil McGuinness
> > ------

 
 
 

Directory's Upper /lower case / Mix case

Post by Arne Ortlinghau » Sun, 02 Mar 2003 03:24:33


Phil,

you can try the code below to get the directories.

Arne Ortlinghaus

FUNCTION Directory2Array( cFiles, uAttributes )

//p Zurckgabe von Dateien in ein Array (wie Directory)

// CompuserveL?sung 26.9.97

//d Directory funktioniert nicht, weil Directory nur die Dateien zurckgibt
mit dem Archivebit gesetzt.

//d die Attribute fr bergabe sind etwas anders definiert.

//d Es werden automatisch die Directories . und .. ausgeblendet.

//d Struktur des Rckgabe-Arrays ist wie aus Funktion DIRECTORY() \line

//d aDir[i,1] Dateiname \line

//d aDir[i,2] Dateigroesse \line

//d aDir[i,3] Datum letztes Schreiben \line

//d aDir[i,4] Uhrzeit letztes Schreiben \line

//d aDir[i,5] Dateiattribute \line

//d Stringkombination aus folgenden Zeichen: \line

//d D Directory \line

//d H Hidden \line

//d S System \line

//a cFiles - String: kompletter Suchpfad mit * oder ?

//a uAttributes - Einschr?nkung der Suchkriterien (String oder nil)

//a Standard ist "FD", Dateien und Directories

//a Character Beschreibung

//a D Directory

//a F Dateien

//a andere Parameter werden ignoriert

//r Array: Feld unter Beschreibung

//g Files

LOCAL aDir AS ARRAY

LOCAL pWin32_Find_Data IS _WINWIN32_FIND_DATA

LOCAL SysTime IS _WINSYSTEMTIME

LOCAL hSearch AS PTR

LOCAL dFileDate AS DATE

LOCAL cFileTime AS STRING

local cFileName as string

local dwAttributes as dword

local cAttributes as string

local lSearchDir as logic

local lSearchFiles as logic

local h,m,s as int

local ftlocaltime IS _WINFILETIME


aDir := {} // Rckgabe-Array, das letzte Element mit den Dateiattributen
bleibt vorerst leer, wir brauchen es bisher nicht!

if IsString(uAttributes)

uAttributes := Upper(uAttributes)

lSearchDir := InStr("D", uAttributes)

lSearchFiles := InStr("F", uAttributes)

endif

hSearch := Null_Ptr

do while iif ( hSearch == Null_Ptr, ;




)


// Datum und Uhrzeit muessen wir noch rauskriegen, also erstmal konvertieren

//von UTC-Time nach lokaler Zeit

FileTimeToLocalFileTime(;


)

//Zerlegen der Zeit

FileTimeToSystemTime(; // Win-API!


// Einzelwerte in VO-Datumsformat umwandeln

dFileDate := CToD( LTrim(Str3(systime.wday,2,0)) + "." +
LTrim(Str3(systime.wmonth,2,0)) + "." + Str3(systime.wyear,4,0))

h := systime.wHour

m := systime.wMinute

s := systime.wSecond

cFileTime := StrZero(h,2) + ":" + StrZero(m,2) + ":" + StrZero(s,2)

dwAttributes := pWin32_Find_Data.dwFileAttributes

cAttributes := ""

if _and (dwAttributes, FILE_ATTRIBUTE_DIRECTORY) != 0

cAttributes += "D"

endif

if _and (dwAttributes, FILE_ATTRIBUTE_HIDDEN) != 0

cAttributes += "H"

endif

if _and (dwAttributes, FILE_ATTRIBUTE_SYSTEM) != 0

cAttributes += "S"

endif

cFileName := AllTrim(cFileName)

if (lSearchDir .and. InStr("D", cAttributes) .and. !InList(cFileName, ".",
"..")) ;

.or. (lSearchFiles .and. !InStr("D", cAttributes))

AAdd(aDir,{cFileName,; // FileName

(pWin32_Find_Data.nFileSizeHigh*MAXDWORD)+pWin32_Find_Data.nFileSizeLow,; //
FileSize

dFileDate,;

cFileTime,;

cAttributes})

endif

enddo

if hSearch != Null_Ptr

FindClose(hSearch)

endif

RETURN (aDir)

 
 
 

Directory's Upper /lower case / Mix case

Post by Phil McGuinnes » Sun, 02 Mar 2003 07:06:29


Arne..

Will give it a test..

Phil
----


Quote:> Phil,

> you can try the code below to get the directories.

> Arne Ortlinghaus

> FUNCTION Directory2Array( cFiles, uAttributes )

 
 
 

Directory's Upper /lower case / Mix case

Post by Geoff Schalle » Sun, 02 Mar 2003 10:34:52


Phil,

There shouldn't be an issue unless you are doing string comparisons in your
app. In which case, the answer is obvious. Simply Upper() everything you
deal with. Its the easiest and safest way to deal with this because
directory and file names are case insensitive. They have to be to maintain
backward compatibility with 8.3 names. But essentially you cannot escape the
issue. Even W2K is not always consistent with is case changes on file and
dir names.

Geoff


Quote:> I have noticed some strange behaviour with some directories I create using
> VO and my client sites.

> Even though I create the Directory as Uppercase.. on some sites this works
> on some sites it makes the 1st character Uppercase and the rest lower case
> and on one 98 box it make it all lower case.
> The same 98 box if you were to supply a name like 'SHERBAC' it would
remain
> in upper case but it you add one more letter it reverts the lot to lower
> case.

> The problem on some machines it does not return the full list of
> Directories...

> Was the code Paul Piko posted on his site to get around this problem of
not
> returning all directories on some machines..

> Damn annoying and very inconsistent.

> Phil McGuinness
> ------

 
 
 

Directory's Upper /lower case / Mix case

Post by Phil McGuinnes » Sun, 02 Mar 2003 17:25:22


snip[ Simply Upper() everything you deal with. ]

All of this done... I suspect this particular machines Directory engine...
is Rooted..

Phil
----


Quote:> Phil,

> There shouldn't be an issue unless you are doing string comparisons in
your
> app. In which case, the answer is obvious. Simply Upper() everything you
> deal with. Its the easiest and safest way to deal with this because
> directory and file names are case insensitive. They have to be to maintain
> backward compatibility with 8.3 names. But essentially you cannot escape
the
> issue. Even W2K is not always consistent with is case changes on file and
> dir names.

> Geoff

 
 
 

1. Formating between lower case and upper case..A puzzle

Hello,

I have a question.

How do I format this command so that when it looks at the cell, it will
recognize both lower case and uper case.

Mystr = "D2"

If Left(h, Len(myStr)) = myStr Then

This if loop looks at a string, lets say "D2" and does something to it.
However if the cell reads "d2", it ignores it. Can
someone hlep format this statement so that it recognizes both "d2" and "D2"

Thank you,

Samantha

2. Frame Rates

3. Changing text from lower case to upper case

4. ISDN Connection Monitor?

5. gvim6: replace all chars in a file to upper case or lower case?

6. D3d Immediate Vs. Retained

7. Can a idl compiler distinguish upper case from lower case ?

8. run matlab in background

9. Kermit changed the file name from lower case to upper case, why???

10. Lower Case to Upper For Excel (Not UPPER Function)

11. changing lower case text to upper

12. Upper and Lower Case in Excel

13. dosfs2: upper/lower case 8.3 file name format