Gadiguibou / stdrename

'stdrename' is a small command line utility to rename all files in a folder according to a specified naming convention (camelCase, snake_case, kebab-case, etc.).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ERROR: Access is denied

ptanmay143 opened this issue · comments

❯ .\stdrename.exe -srD "C:\Users\ptanmay143\!data"
Application error: The system cannot find the path specified. (os error 3)

Hello, @ptanmay143, can you provide a bit more details concerning the error you're getting?

I have a directory named "!data" and I am trying to rename everything in it (files, folders, subfiles and subfolders too) from kebab-case to snake_case. For this I am using stdrename using the -s option for snake_case, -r option for recursive renaming and -D option for enabling directory rename support. As you can see from the above, stdrename gives the output as error.

System details

Host: Windows 10 Pro 2004 x64
Version: stdrename v1.1.0

I can't seem to replicate this error and since this is an os error, it is the operating system that is throwing it when interacting with its api, not stdrename. This is the regular output I'm getting on Windows.

PS C:\Users\lacro\projects\stdrename> stdrename -srD "C:\Users\lacro\!data"
0 files renamed in 0.001718 s. See you next time!
(^ _ ^)/

When specifically denying full control to the user over this folder and its subfolders, I get the following.

PS C:\Users\lacro\projects\stdrename> stdrename -srD "C:\Users\lacro\!data"
Application error: C:\Users\lacro\!data: IO error for operation on C:\Users\lacro\!data: Access is denied. (os error 5)

Is there something specific about this folder that might cause the problem? Have you tried stdrename on another test folder to see if it throws the same error?

I tried using stdrename on Linux using cargo install stdrename. This still gives the error:
❯ stdrename -krD /mnt/d/10-data-sync/
Application error: Directory not empty (os error 39)

Is there a switch I can toggle to enable developer logs of this program so that the issue could be solved.

For now, there isn't an option for a more verbose logging as it is just returning the error message from the os's api. I could add it for the next versions if this really has a use. I understand this is probably infuriating. Could you please try to use stdrename on another folder first to test if this is a problem on the application side? If it works on another folder try to check the permissions on this folder and its files and subfolders. Are you able to rename them manually in your file explorer? If nothing comes out of the above, try running the same command without recursion and directory renaming, or try running the program as sudo.