I want to count() the number of Files in a certain Directory.
IF EXISTS(T_Path+'nul') THEN BEGIN
R_File.RESET;
R_File.SETRANGE(Path,T_Path);
R_File.SETRANGE("Is a file",TRUE);
I_NumberOfFiles:=R_File.COUNT();
END;
Everything works fine up to the point where the Count is issued.
Some users do have the permission to read that certain path, and some users don't.
For those user who don't have access a message appeas saying "The os doesn't allow acces ...".
How can I test the permission and avoid the message. The Exist test doesn't help me, since the path really exists and Exist always gives TRUE in return.
I hope you understand the problem.
Answers
for example:
viewtopic.php?f=23&t=30150
For me it worked with the Codeunit Trick. Just returning the result of the File.Findfirst() works like a charm.