Move some generally useful file functions from cf-agent/files_lib to libutils/file_lib