Can't rename folder (PHP + Linux) -
I have a weird problem:
I will create subfolders in the Linux TMP folder with the help of PHP
mkdir (sys_get_temp_dir (). DIRECTORY_SEPARATOR. 'Subfolder');
Then I try to rename the PHP name with this name (func) I try to do this:
rename ('/ tmp / Subfolder ',' / other / folder / name ');
But this gives me a strange warning:
Warning: Rename (): The first argument of the copy () function can not be a directory
Do these folders have something to do with access rights? Any ideas?
Do your / tmp
with a different file system on / Other
? If you want to separate your temporary file storage, this would be a good practice, which could fill the garbage, e.g. / var
(which can be filled with logs!)
If this is the case, then PHP is a main bug that prevents from renaming ()
to work on file system firmly:
to use exec ("mv" ...)
Quoted, but more strongly you can:
if (@dename ($ from, from $)) {return; } Exec ("mv". Escapeshellarg ($ from). "". Escapeshellarg ($ to));
If you finish it in a function or method, you can call it Bayer Rename ()
instead.
Comments
Post a Comment