MCPcopy Create free account
hub / github.com/denoland/std / copyFileSync

Function copyFileSync

fs/copy.ts:115–128  ·  view source on GitHub ↗
(
  src: string | URL,
  dest: string | URL,
  options: InternalCopyOptions,
)

Source from the content-addressed store, hash-verified

113}
114/* copy file to dest synchronously */
115function copyFileSync(
116 src: string | URL,
117 dest: string | URL,
118 options: InternalCopyOptions,
119) {
120 ensureValidCopySync(src, dest, options);
121 Deno.copyFileSync(src, dest);
122 if (options.preserveTimestamps) {
123 const statInfo = Deno.statSync(src);
124 assertIsDate(statInfo.atime, "statInfo.atime");
125 assertIsDate(statInfo.mtime, "statInfo.mtime");
126 Deno.utimeSync(dest, statInfo.atime, statInfo.mtime);
127 }
128}
129
130/* copy symlink to dest */
131async function copySymLink(

Callers 3

copyDirSyncFunction · 0.70
copySyncFunction · 0.70

Calls 4

ensureValidCopySyncFunction · 0.85
assertIsDateFunction · 0.85
statSyncMethod · 0.65
utimeSyncMethod · 0.65

Tested by

no test coverage detected