use library instead of system for mkdir