EFF Guide to Defending Privacy at the U.S. Border
When you cross the U.S. border, government officials can confiscate your electronic devices, search them, and keep them for a while for additional scrutiny, even when there’s no suspicion of wrongdoing. If you travel out of or into the United States, do yourself a favor and read the EFF’s comprehensive guide to what can happen, and what you can do about it.
If you are not a U.S. citizen, beware: if a U.S. immigration officer thinks that you are not telling the truth, then he is entitled to bar you from entering the country for five years--without any right of judicial appeal.
To do this he does not need to have any reason, all he needs is to distrust or dislike you and to have his immediate supervisor back him up.
If you are not a U.S. citizen, you will want to arrange your electronic files so that you can be perfectly open and aboveboard at the border (and you will want to be pleasant and respectful no matter what).
That may be the case elsewhere, but I do not think the first paragraph is applied here in California.
It may be that for some reason the federal government runs its California immigration offices differently from those elsewhere, but do realize that whenever some naive student or businessman with an awkward accent is denied entry, no Californian is likely to hear about it, because he will not be permitted to contact anybody, not even waiting family or a lawyer. Neither is he likely to be in a position to attract media attention in the States after his return home. However, outside the United States these stories are heard (and add to the reasons that the country is not loved).
Some years ago, Farley Mowat was denied entry. It happens that that Farley Mowat had been invited to the States to receive a literary award, and so was uniquely able to publicize his experience. He wrote a delightful book about it, "My Discovery of America." Mowat was barred on order from on high but now field officers with even less knowledge have the discretion to do the same.