MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / PreserveMetadataUtf8

Function PreserveMetadataUtf8

src/tools/PlatformIO.cpp:252–271  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252int PreserveMetadataUtf8(const std::string& source,
253 const std::string& target) {
254#ifdef _WIN32
255 (void)source;
256 (void)target;
257 return 0;
258#else
259 struct stat sourceStat;
260 if (stat(source.c_str(), &sourceStat) != 0) {
261 return -1;
262 }
263 if (chown(target.c_str(), sourceStat.st_uid, sourceStat.st_gid) != 0) {
264 return -1;
265 }
266 if (chmod(target.c_str(), sourceStat.st_mode & 07777) != 0) {
267 return -1;
268 }
269 return 0;
270#endif
271}
272
273int ReplaceFileUtf8(const std::string& source, const std::string& target) {
274#ifdef _WIN32

Callers 1

ConvertFileFunction · 0.85

Calls 1

statClass · 0.70

Tested by

no test coverage detected