文件操作 - termux.js
返回文件管理
返回主菜单
删除本文件
文件: /var/www/OLD/node_modules/clipboardy/lib/termux.js
编辑文件内容
import {execa, execaSync} from 'execa'; const handler = error => { if (error.code === 'ENOENT') { throw new Error('Couldn\'t find the termux-api scripts. You can install them with: apt install termux-api'); } throw error; }; const clipboard = { async copy(options) { try { await execa('termux-clipboard-set', options); } catch (error) { handler(error); } }, async paste(options) { try { const {stdout} = await execa('termux-clipboard-get', options); return stdout; } catch (error) { handler(error); } }, copySync(options) { try { execaSync('termux-clipboard-set', options); } catch (error) { handler(error); } }, pasteSync(options) { try { return execaSync('termux-clipboard-get', options).stdout; } catch (error) { handler(error); } }, }; export default clipboard;
修改文件时间
将文件时间修改为当前时间的前一年
删除文件