Skip to content

File permissions are not maintained #1

@thehomerepot

Description

@thehomerepot

The script does the following to copy/rename the files.
copy($filename, $newname);
unlink($filename);

# Rename the file back to what it was originally called.
rename($newname, $filename);

You should probably add the following after the copy function to maintain permissions.
chown($newname, fileowner($filename));
chgrp($newname, filegroup($filename));
chmod($newname, fileperms($filename));

I'm not a PHP scripter so I just kind of threw this together. There may be an easier way to accomplish this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions