preserve file modes for up- and downloads - fixes #4141

This commit is contained in:
Eugene Pankov
2021-07-10 20:39:45 +02:00
parent 3e61630c6a
commit 0008b2f022
6 changed files with 35 additions and 13 deletions

View File

@@ -71,7 +71,7 @@ export class DebugDecorator extends TerminalDecorator {
private async saveFile (content: string, name: string) {
const data = Buffer.from(content)
const transfer = await this.platform.startDownload(name, data.length)
const transfer = await this.platform.startDownload(name, 0o644, data.length)
if (transfer) {
transfer.write(data)
transfer.close()

View File

@@ -113,7 +113,7 @@ export class ZModemDecorator extends TerminalDecorator {
this.showMessage(terminal, colors.bgYellow.black(' Offered ') + ' ' + details.name, true)
this.logger.info('offered', xfer)
const transfer = await this.platform.startDownload(details.name, details.size)
const transfer = await this.platform.startDownload(details.name, 0o644, details.size)
if (!transfer) {
this.showMessage(terminal, colors.bgRed.black(' Rejected ') + ' ' + details.name)
xfer.skip()