using blocking and using file method