Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Technique to validate a file name
Message
From
20/03/1998 12:18:20
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
20/03/1998 11:50:46
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00086002
Message ID:
00086037
Views:
22
>>>What would be the best technique to validate a file name? I am also looking to see if someone has already done that.
>>>
>>>What I need to have is a function which will validate a string to see if this is a valid file name. The string can be something like c:\data\client1\reports\monthly.txt.
>>>
>>>The first part is to validate for all non accepted character in the string.
>>>
>>>The second part is to validate is the path is valid.
>>>
>>>Any technique, advise or sample is appreciated.
>>
>>Michel,
>>
>>Look in the Extended Foxtools Help file at ValidPath() or CleanPath(). The only problem with these functions is that they're inexact when it comes to long file names.
>
>Thanks but I'll have to avoid this technique as long file names are possible.
Hi Michel,
mFilename = "c:\data\client1\reports folder is here\monthly.txt"
if file(mFilename)
 return .t.
endif
handle = fcreate(mFilename)
if handle < 0
 return .f.
endif
=fclose(handle)
erase (mfilename)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform