  Although there is not a complete "proof" of the second law of thermo-
dynamics based on microscopic dynamics, two properties of Hamiltonian systems
have been used to prove the impossibility of work extraction from a single
thermal reservoir: Liouville's theorem and the adiabatic invariance of the
volume enclosed by an energy shell. In this paper we analyze these two
properties in the Szilard engine and other systems related with the Maxwell
demon. In particular, we recall that the enclosed volume is no longer an
adiabatic invariant in non ergodic systems and explore the consequences of this
on the second law.
