cross-platform handle files