Skip to content

rename.pl reporting success when no permission & failure #1

@hepcat72

Description

@hepcat72

I added an error when the target file name doesn't exist after the rename is done. This file is in a directory without write permission to me. I also don't have permission to write to the file (i.e. cannot delete):

Renaming [291_DG3-read-4.fastqsanger] to [DG3-read-4.fastqsanger].
ERROR:/Genomics/grid/users/rleach/pub/filetools/rename.pl:LINE192: Unable to rename [291_DG3-read-4.fastqsanger].  No such file or directory

Before I added that code, the script was telling me it was successfully renaming that fiule (and all the other files).

E.g.

cp 202_DG1-read-3.fastqsanger DG1-read-3.fastqsanger
cp: cannot create regular file `DG1-read-3.fastqsanger': Permission denied

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