MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / writeSync

Method writeSync

packages/core/file-system/index.ts:578–596  ·  view source on GitHub ↗
(content: any, onError?: (error: any) => any)

Source from the content-addressed store, hash-verified

576 }
577
578 public writeSync(content: any, onError?: (error: any) => any): void {
579 this._checkAccess();
580
581 try {
582 this._locked = true;
583
584 const that = this;
585 const localError = function (error) {
586 that._locked = false;
587 if (onError) {
588 onError(error);
589 }
590 };
591
592 getFileAccess().writeSync(this.path, content, localError);
593 } finally {
594 this._locked = false;
595 }
596 }
597
598 public readText(encoding?: string): Promise<string> {
599 return new Promise((resolve, reject) => {

Callers

nothing calls this directly

Calls 3

_checkAccessMethod · 0.95
getFileAccessFunction · 0.85
writeSyncMethod · 0.65

Tested by

no test coverage detected