Ask coding questions

← Back to all posts
How to hide folders and files from viewers in public repls?
MartiaForoud (55)

I do not use a database, so i want to hide a certain folder from viewers. is it possible?



Using encryption is one good thing. or you could use the zip file too.

Wumi4 (481)

Maybe pack the folder in a zip file and using encryption tools like GPG to encrypt it? The user still sees it but cannot do anything with them unless they decrypt it.

Or another trick that only works in Linux and Unix-based is to pack that folder in a zip file, rename the folder to .folder_name, so the user can't see it. Not even in the repl, unless they do ls -a on the shell.

MartiaForoud (55)

@Wumi4 Hmmm, thanks!
I am gonna use the zip thing in PHP, and store the password in a .env file!

programmeruser (575)

@Wumi4 the .folder_name trick doesn't work on since it displays the folder anyways.