add memonly/fileonly support for scan