Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Need a method to create a file path from passed string.
Message
From
19/02/2010 11:48:28
 
 
To
19/02/2010 11:29:10
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01449783
Message ID:
01449929
Views:
43
To clarify: Since Windows is case-insensitive, it does not perceive any difference between these folder names:

C:\SomeThing
C:\something
C:\SoMeThinG

When you invoked MD to create a folder (or folders, possibly), it created folder names that it considers to be the same as the names you gave it.

The fact that you consider the names to be different is actually your problem, not its. You could only reasonably expect the cast of your folder names to be maintained if in fact Windows was case-sensitive.

So, MD did in fact work.

>Clarify: It d does not work in that it indeed creates the folders very nicely, but it does not obey the casing that I give it.
>
>In this situation, I want all upper case. I'm getting all lower case when calling MD.
>
>
>>does not work ??
>>
>>I thought it did work, and created the intermediate folders. The fact that it did not preserve case doesn't mean it didn't work -- since Windows is not case sensitive, it did in fact create the folders you asked for.
>>
>>
>>>Why?
>>>
>>>Come on... One line of code. That's why. (If it worked the way I want). His thing is like a sledge hammer. However, now that the simple MD does not work, I may well be forced to go with his code. Which I will be thankful for his contribution.
>>>
>>>
>>>
>>>>Sergey provided you with the link of doing so and preserving the case name - so why did you go with MD ?
>>>>
>>>>Also, don't use macro in MD line, use name expression MD (myFolderPath)
>>>>
>>>>Finally, also check Sergey's site for the Opening Windows Explorer for a specified path.
>>>>
>>>>Open WE for specified path
>>>>
>>>>>Get this...
>>>>>
>>>>>When I run MD from the *command line*, the folders created will honor the upper case all caps:
>>>>>
>>>>>
>>>>>MD "F:\QUOTE\GHT001\12345"
>>>>>
>>>>>
>>>>>But, when I call the MD command from within a method in a form, it's being created in lower case!!!! I know the values I'm giving it are UPPER CASE.
>>>>>
>>>>>
>>>>>
>>>>>Lparameters tcFolderPath, tlOpenInExplorer
>>>>>
>>>>>If Empty(tcFolderPath)
>>>>> tcFolderPath = this.GetFolderName()
>>>>>EndIf
>>>>>
>>>>>Try
>>>>> Md &tcFolderPath && Create the folder
>>>>>Catch
>>>>>EndTry
>>>>>
>>>>>If tlOpenInExplorer  
>>>>> Run /N "explorer" &tcFolderPath && Open Windows Explorer to the folder
>>>>>EndIf
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>My OS is Win7 64-bit and I'm writting to a Windows Server 2003.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>See http://www.berezniker.com/content/pages/visual-foxpro/creating-directory-preserving-name-case
>>>>>>
>>>>>>>Anyone know of any utils for VFP that will create a folder path given a passed in string?
>>>>>>>
>>>>>>>
>>>>>>> CreateFolderPath("F:\Quotes\GTH001\12345\")
>>>>>>>
>>>>>>>
>>>>>>>Some parts of the paths may already exist, some may not. I just need it to handle all the relevant issue. If it exists, then fine, it not, create whatever is missing.
Jim Nelson
Newbury Park, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform