Server IP : 85.214.239.14 / Your IP : 3.140.189.171 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /proc/3/task/3/root/proc/3/cwd/lib/node_modules/npm/node_modules/rimraf/dist/esm/ |
Upload File : |
// The default temporary folder location for use in the windows algorithm. // It's TEMPting to use dirname(path), since that's guaranteed to be on the // same device. However, this means that: // rimraf(path).then(() => rimraf(dirname(path))) // will often fail with EBUSY, because the parent dir contains // marked-for-deletion directory entries (which do not show up in readdir). // The approach here is to use os.tmpdir() if it's on the same drive letter, // or resolve(path, '\\temp') if it exists, or the root of the drive if not. // On Posix (not that you'd be likely to use the windows algorithm there), // it uses os.tmpdir() always. import { tmpdir } from 'os'; import { parse, resolve } from 'path'; import { promises, statSync } from './fs.js'; import platform from './platform.js'; const { stat } = promises; const isDirSync = (path) => { try { return statSync(path).isDirectory(); } catch (er) { return false; } }; const isDir = (path) => stat(path).then(st => st.isDirectory(), () => false); const win32DefaultTmp = async (path) => { const { root } = parse(path); const tmp = tmpdir(); const { root: tmpRoot } = parse(tmp); if (root.toLowerCase() === tmpRoot.toLowerCase()) { return tmp; } const driveTmp = resolve(root, '/temp'); if (await isDir(driveTmp)) { return driveTmp; } return root; }; const win32DefaultTmpSync = (path) => { const { root } = parse(path); const tmp = tmpdir(); const { root: tmpRoot } = parse(tmp); if (root.toLowerCase() === tmpRoot.toLowerCase()) { return tmp; } const driveTmp = resolve(root, '/temp'); if (isDirSync(driveTmp)) { return driveTmp; } return root; }; const posixDefaultTmp = async () => tmpdir(); const posixDefaultTmpSync = () => tmpdir(); export const defaultTmp = platform === 'win32' ? win32DefaultTmp : posixDefaultTmp; export const defaultTmpSync = platform === 'win32' ? win32DefaultTmpSync : posixDefaultTmpSync; //# sourceMappingURL=default-tmp.js.map