Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@tansy
Copy link
Contributor

@tansy tansy commented Jan 31, 2025

Trying to compile it under windows I got undefined reference to 'fchmod'. I was surprised to discover that windows doesn't have that function, so I patched that with 0, so it didn't generate errors, though it won't work there.
Patch come from Lzip where I got the idea of preserving file attributes in first place. If it's good enough there, it can be here.

@mcmilk
Copy link
Owner

mcmilk commented Jan 31, 2025

Maybe you could create some wrapper?
Just disabling the fchmod() function isn't sth. nice to have :(

Binaries for windows are easily generated via MinGW.

@tansy
Copy link
Contributor Author

tansy commented Jan 31, 2025

Binaries for windows are easily generated via MinGW.

That's what I did, and how I discovered it.

Just disabling the fchmod() function isn't sth. nice to have :(

Not an expert on windows/mingw. After adding that feature in Linux, I thought it was supported by mingw as I know p/lzip working in windows. Didn't realise that particular thing is absent there. While I was researching it last time I picked simplest one I could possibly find and understand.
Still nice to have it in Linux; before that was nowhere.

Will have a look but I can't promise it now.

@mcmilk
Copy link
Owner

mcmilk commented Jan 31, 2025

Hello @tansy - I added a commit, would you mind to check if this works es expected?

@tansy
Copy link
Contributor Author

tansy commented Feb 1, 2025

I can confirm that it works, I mean, doesn't crash.

Ed: setting/preserving timestamps doesn't work in MinGW. It works in Linux though.
Don't know why, although I investigated it but it only frustrates me - utime() works, returns 0, but changes to timestamp does not appear.
I can't figure it out. Maybe someone has more experience with MinGW/Windoze idiosyncrasies.

@mcmilk mcmilk closed this Feb 2, 2025
@tansy tansy deleted the fchmod-win branch February 3, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants