copyFileMeta function
Copy the file meta for executable
Implementation
Future<int> copyFileMeta(File src, File dst) async {
var srcMode = (await src.stat()).mode;
var dstMode = (await dst.stat()).mode;
if (dst is FileExecutableSupport) {
if (dstMode != FileStat.modeNotSupported) {
if (srcMode != FileStat.modeNotSupported) {
if (_isUnixExecutable(srcMode) != _isUnixExecutable(dstMode)) {
await (dst.setExecutablePermission(_isUnixExecutable(srcMode)));
}
}
}
}
return 0;
}