Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access to path is denied #37

Open
GoosiferIO opened this issue Aug 7, 2023 · 2 comments
Open

Access to path is denied #37

GoosiferIO opened this issue Aug 7, 2023 · 2 comments
Labels

Comments

@GoosiferIO
Copy link

GoosiferIO commented Aug 7, 2023

Hi jbl. Just started using your program after reading through your thread at Tek and starting my own project. Great job on its development.

I'm having trouble with a few errors but not quite sure how to work around them.

  • 'Access to the path ______ is denied'
    • This usually happens when I'm prompted to degrade colors from what I have to what ZT1 supports, so it's likely color-related.

I thought maybe it was beginner pains so I tried converting the PNG files in the tutorial files but then I get this error:

Directory name 'sitscratch' is invalid.

The limit of a folder name is a maximum of 8 alphanumeric characters.

You will need to rename the folder manually and then retry.

Since this error may lead to other issues, ZT Studio will now close completely.

'sitscratch' is a directory provided in the tutorial files. If I rename it to something shorter I get the same 'access to path is denied' mentioned above (after I refresh and app restart to propagate any file name changes). The directory my root folder lives in is an arbitrary space in my Documents folder.

I noticed in your issue tracker that ZT Studio currently has missing error handling. If I have time to spare this coming semester I would love to try contributing any improvements in that area; if you would have me anyway.

Goosifer (from Tek)

@jbostoen
Copy link
Owner

jbostoen commented Aug 7, 2023

Good observation!

"sitscratch" would indeed be invalid, as it contains more than 8 characters and - as far as I'm aware - the default used by Zoo Tycoon is only 8 characters.

I checked in the released files ( https://zootekphoenix.com/forums/files/file/3401-red-panda-by-vondell-and-jbl89/ ), there it's indeed also "sitscratch" folder with graphics. However, in the configuration file it's unused. I think at some point I just added this check, as Blue Fang had the habit to use maximum 8 characters per folder name. But I guess it's not a strict limit either.

As you can see, I haven't touched the code for nearly 4 years. That's probably also about the time I haven't had Visual Studio or Zoo Tycoon installed. I've spent hours on Zoo Tycoon when I was a kid; then I created this tool because I needed it for a project I had in mind at that time. It was highly experimental and I wasn't too familiar yet with best practices coding wise, so the error handling in this project is indeed a bit of a mess. :|

I probably won't pick it up myself anytime soon, but feel free to fork, or even better, create a pull request.

The check is found here. Seems like I even added a specific comment about "sitscratch" in the past:

If Path.GetFileName(StrDirectoryName).Length > 8 Or System.Text.RegularExpressions.Regex.IsMatch(Strings.Replace(Path.GetFileName(StrDirectoryName), "-", ""), "^[a-zA-Z0-9_-]+$") = False Then

The pull request would be easy, but I'd need to reinstall Visual Studio first solely for this; and then of course it should be properly tested in Zoo Tycoon.

For now, I would simply suggest deleting the "sitscratch" folders.

@jbostoen jbostoen added the bug label Aug 7, 2023
@GoosiferIO
Copy link
Author

GoosiferIO commented Aug 7, 2023

That makes sense, thanks jbl. I leave a lot of legacy files for testing in my coding projects as well--I consider it part of the job :P

Sounds good about the contributions. Likely I'll start reading through the ZT Studio code some time around September or October. I have quite a few ZT-related projects I'd like released before end of summer so I should be responsible with my commitments haha.

On the meantime I've figured out a workaround jumping between Zoot and ZT Studio.

I will keep you posted in the Fall about any contributions I may be able to PR your way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants