Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fox 2.6 FCREATE() won't create lower case file name

Status
Not open for further replies.

terhobey

Programmer
Apr 16, 2002
11
US
Recently one of our legacy FoxPro 2.6 apps that creates a file for transfer purpose has been creating the file in uppercase. The name has to be in lowercase. Thinking it was a Novell directory thing or OS problem, I tried some experitmenting.
Used Access code in a module to create a file in the same directory, no problem all lowercase. Creating as file from Notepad, same thing correct. Tred creating another file with FCREATE in Fox unsing a literal "tstfile.dat" and ran in trace, file created in all upper case. Ran after compile and out of trace same result.
Any Ideas???
 
I just checked and my 2.6 fcreate() and it creates files the way it is told to
lnHandle=fcreate("test.txt",0) && creates a lower case file
lnHandle=fcreate("TEST.TXT",0) && creates a upper case filelnHandle=fcreate("Test.txt",0) && creates a mixed case file

Now you stated
"Recently one of our legacy FoxPro 2.6 apps that creates a file for transfer purpose has been creating the file in uppercase."
So My question is "What has changed on your network?"
Because computer programs can not alter themselves so if it has been working for years something else is the problem not the program.
David W. Grewe
Dave@internationalbid.com
 
The case of file names created by a FP 2.x app is strictly OS (and NOS) dependent. FP 2.x code is DOS based and it knows nothing of long file names - just the old uni-case 8.3 DOS standard.

Check for OS and or configuration changes - there is nothing you can do programmatically. (Except perhaps write a .BAT file to rename the file to the casing you want, and RUN it once you know the file exists.)

Rick
 
Thanks Guys, yeah I realize it isn't programatic, but we've ruled out the OS and network issues by creating files from code in Access, VB etc. The only layer left is that the code is run through the 2.6 interface. I mean the AR2SUMMIT.exe (that's the name of the exe) is launched through the 2.6 FoxPro interface, so is there some level of property involved there? Make Sense?
 
I don't seem to recall any DOS versions of Access or VB :)(QBasic - yes). Windows programs don't go through DOS to create / rename files, they use the Windows API, and THEY can specify a case specific file name. Note however that internally the OS still doesn't really use the case of any letters except for display - just try to create ABC.TXT, abc.txt and AbC.tXt in the same directory with any Windows program on a Windows based file system.

Rick
 
Yes, I do see what (all) of you are saying. I guess what I am saying is: It's not just a display thing. The file name is left in the directory in uppercase (Ascii characters uppercase). Any application I can use VB, Access (true they use an API for file activities)will leave a file name in whatever case we create, be it "TST.TXT", "tst.txt", or "TsT.tXt". All works great, all in the directory. Using FoxPro creating a file in code or even using the rename command, no matter, will only leave a file in uppercase. period. Both from an exe or prg in trace, either/or. Why has this behavior began? Is there some Fox API? Properties. Our OS and network guys can't figure it out, we are all programers and nerds with 20 years +. ??? All though admitted not FoxPro experts.
Thanks,
Terry
 
Terry,
I just ran the following program in three versions of FoxPro under XP Pro, and got the results as shown below. (I could have run it under at least 5 other versions of FoxPro, but I hope you get the idea!)
Code:
xx=fcreate("C:\TestABC.TxT")
?xx
?fclose(xx)
FP DOS 2.6a - C:\TESTABC.TXT
FP Windows 2.6a - C:\TESTABC.TXT
VFP 7.0 SP1 - C:\TestABC.TxT

The old DOS based versions (pre 3.0), only knows about the DOS 8.3, all upper (or lower depending on the displayer) file name storage system. They simply don't use (can't access) the newer, case dependent, long file name API, like the current (non-obsolete) versions of Visual FoxPro do.

Note: I wasn't suggesting you use the FoxPro RENAME, but rather the OS's RENAME. This seems to work:
Code:
xx = fcreate("c:\myren.bat")
?fput(xx, "RENAME C:\TESTABC.TXT TestABC.TxT")
?fclose(xx)
! c:\myren.bat
Rick
 
Thankyou,
I will try this right away! Seems like a good solution.

Thanks in advance,

Terry
 
Opps,
Works on a local directory, however when the bat file is launched and run on the production network directory it doesn't seem to change the case.
I will try some more experimenting, but I think the OS API connection with the older FoxPro is right on.
Thanks again,
Terry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top