What is "Lachpor"?
Rashi: It is to spy (search), like "mi'Sham Chafar Ochel" (Iyov 39:29).
Radak: It is like Lasur
How did the people know that the men who came to Rachav were spies?
Malbim: (a) Yericho was well closed
It says so below (6:1), after they knew that spies had come, and after Yisrael crossed the Yarden. Here, verse 5 says that they closed the gate, i.e. initially it was open! Perhaps Malbim means that no one was allowed to enter or leave at night. (PF)