Is there any api i can use to lock files or folder, preventing them to be accessible from the user???

i tried to open the file without any sharing, it works alright, but it would be a little slow if i want to lock a folder with many many files in it...