Hi, how can i knwo if a sub-directory exists in a directory using progress :
example : "C:\X\Y" exists in "C:\X\"
Hi, how can i knwo if a sub-directory exists in a directory using progress :
example : "C:\X\Y" exists in "C:\X\"
Flag this post as spam/abuse.
but then 'y' can be a file as well ;-)
I would check:
IF index("D", FILE-INFO:FILE-TYPE) > 0 then
/* it exists */
err:
IF index(FILE-INFO:FILE-TYPE, "D") > 0 THEN...
Oh what a joy it would have been if the parameter order of the INDEX and LOOKUP function would be the same...
Oh what a joy it would have been if the parameter order of the INDEX and LOOKUP function would be the same...
Flag this post as spam/abuse.
Another option is to use .NET. I know in 10.2B the System.IO.FileInfo was much faster than the ABL FILE-INFO
oDirectory = NEW System.IO.DirectoryInfo ("FolderName").
IF oDirectory:EXISTS THEN
That is of course if running on windows.
Another option is to use .NET. I know in 10.2B the System.IO.FileInfo was much faster than the ABL FILE-INFO
oDirectory = NEW System.IO.DirectoryInfo ("FolderName").
IF oDirectory:EXISTS THEN
Flag this post as spam/abuse.
[quote user="Peter Judge"]
[/quote]
Of course 1^infinity = 1
But that's completely besides the point :-)
(sorry, couldn't resist)
You can even check more on the file-type, like the following
H The file is hidden.
R The file is readable.
W The file is writeable.
...
The difference between 15ms and 1ms may seem like a lot and could be significant if you were executing it in a tight loop thousands of times and doing little other work, but if there is UI or DB access or whatever in that loop, then you will never see that difference.
The difference between 15ms and 1ms may seem like a lot and could be significant if you were executing it in a tight loop thousands of times and doing little other work, but if there is UI or DB access or whatever in that loop, then you will never see that difference.
Flag this post as spam/abuse.