fs.rename(from, to,(err)=>{if(err) { reject(err); }else{ resolve(); } }); }); 开发者ID:3L4CKD4RK,项目名称:angular-cli,代码行数:9,代码来源:fs.ts 示例4: cleanAsync ▲点赞 2▼ asyncfunctioncleanAsync(series: mio.IScraperSeries){letchapterPaths = series.chapters.map(seriesChapter...
it('detects file renames inside a directory', function(done){ let fd = fs.openSync(dataDirectory + '/.file', 'w'); fs.closeSync(fd); const watcher = createWatcher(''); let count = 0; watcher.on('rename', (filename) => { count++; if (count === 1) { expect(filename).to....
The following examples show how to use fs-extra#rename. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar. Example...
renameOriginal approach:import fse from 'fs-extra'; async function r(o: string, n: string) { try { await fse.rename(o, n); return true; } catch (error) { } return false; } const result = await r(oldPath, newPath); // true - successfully renamed // false - an error occurred...
fs.rename(src, dest, errorCallback); fs.renameSync(src, dest); fs.truncate(path, len, errorCallback); fs.truncateSync(path, len); fs.chown(path, uid, gid, errorCallback); 开发者ID:gilamran,项目名称:DefinitelyTyped,代码行数:31,代码来源:fs-extra-tests.ts ...
importkFse,{rename}from'@kikiutils/fs-extra';constdata=awaitkFse.readJson(path);// Any json data - successfully read// undefined - an error occurredconstresult=awaitrename(oldPath,newPath);// true - successfully renamed// false - an error occurred ...
realpathSync export const rename = fsExtra.rename export const renameSync = fsExtra.renameSync export const rm = fsExtra.rm export const rmSync = fsExtra.rmSync export const rmdir = fsExtra.rmdir export const rmdirSync = fsExtra.rmdirSync export const stat = fsExtra.stat export const statSync...
Rewritemoveto usefs.renamewhere possible (#549) Don't convert relative paths to absolute paths forfilter(#554) copy*'s behavior whenpreserveTimestampsisfalsehas been OS-dependent since 5.0.0, but that's now explicitly noted in the docs (#563) ...
mkdirs(chunkDir); } // fs-extra 专用方法,类似 fs.rename 并且跨平台 // fs-extra 的 rename 方法 windows 平台会有权限问题 // https://github.com/meteor/meteor/issues/7852#issuecomment-255767835 await fse.move(chunk.path, path.resolve(chunkDir, hash)); res.end("received file chunk"); }...
Rewrite move to use fs.rename where possible (#549) Don't convert relative paths to absolute paths for filter (#554) copy*'s behavior when preserveTimestamps is false has been OS-dependent since 5.0.0, but that's now explicitly noted in the docs (#563) Fix s...