Closed jwreep closed 3 years ago
Fair point. What is the equivalent command for windows? Out of curiosity, does this work in WSL?
As I recall, it's 'attrib' as in file attributes. However, anything compiled as a .exe under Windows should be automatically executable.Sent via the Samsung Galaxy S7 active, an AT&T 4G LTE smartphone -------- Original message --------From: Will Barnes notifications@github.com Date: 12/18/20 10:42 PM (GMT-06:00) To: rice-solar-physics/pydrad pydrad@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [rice-solar-physics/pydrad] configure.py -- chmod does not work in Windows (#139) Fair point. What is the equivalent command for windows? Out of curiosity, does this work in WSL?
—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.
Ah ok. The chmod is actually for the .bat file, not the .exe.
Yes, but it shouldn’t be necessary to change the permissions of an .exe file under Windows. It should be executable by default. The attrib command is typically used to make files read only (or undo same), etc.
From: Will Barnes notifications@github.com Sent: Saturday, December 19, 2020 12:53 AM To: rice-solar-physics/pydrad pydrad@noreply.github.com Cc: sjbradshaw stephen.bradshaw@rice.edu; Comment comment@noreply.github.com Subject: Re: [rice-solar-physics/pydrad] configure.py -- chmod does not work in Windows (#139)
Ah ok. The chmod is actually for the .bat file, not the .exe.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rice-solar-physics/pydrad/issues/139#issuecomment-748430305 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC6C7UKAFRLRQJAAGFLUQTSVRETDANCNFSM4VBZIOTA . https://github.com/notifications/beacon/ACC6C7V55YP4JCMHF3ZOI2LSVRETDA5CNFSM4VBZIOTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFSOCHYI.gif
Oh, . bat files should be executable by default too. Sorry, just realized what you were referring to. [The other executable is a .com file, just fyi]
From: Stephen Bradshaw stephen.bradshaw@rice.edu Sent: Saturday, December 19, 2020 1:11 AM To: 'rice-solar-physics/pydrad' reply@reply.github.com; 'rice-solar-physics/pydrad' pydrad@noreply.github.com Cc: 'Comment' comment@noreply.github.com Subject: RE: [rice-solar-physics/pydrad] configure.py -- chmod does not work in Windows (#139)
Yes, but it shouldn’t be necessary to change the permissions of an .exe file under Windows. It should be executable by default. The attrib command is typically used to make files read only (or undo same), etc.
From: Will Barnes <notifications@github.com mailto:notifications@github.com > Sent: Saturday, December 19, 2020 12:53 AM To: rice-solar-physics/pydrad <pydrad@noreply.github.com mailto:pydrad@noreply.github.com > Cc: sjbradshaw <stephen.bradshaw@rice.edu mailto:stephen.bradshaw@rice.edu >; Comment <comment@noreply.github.com mailto:comment@noreply.github.com > Subject: Re: [rice-solar-physics/pydrad] configure.py -- chmod does not work in Windows (#139)
Ah ok. The chmod is actually for the .bat file, not the .exe.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/rice-solar-physics/pydrad/issues/139#issuecomment-748430305 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC6C7UKAFRLRQJAAGFLUQTSVRETDANCNFSM4VBZIOTA . https://github.com/notifications/beacon/ACC6C7V55YP4JCMHF3ZOI2LSVRETDA5CNFSM4VBZIOTKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFSOCHYI.gif
Maybe it would just be easiest to add a flag to optionally skip the chmod step?
This also definitely makes the case for running tests on multiple operating systems
A quick check should be sufficient:
import platform
if platform.system() != 'Windows':
run_shell_command(...)
chmod
is not a valid command in a Windows shell, so the following snippet fails under Windows:https://github.com/rice-solar-physics/pydrad/blob/bc1e0e74f02f9d714f36d7412723a1a3c3c4db3d/pydrad/configure/configure.py#L129-L133
Similarly a bit further down: https://github.com/rice-solar-physics/pydrad/blob/bc1e0e74f02f9d714f36d7412723a1a3c3c4db3d/pydrad/configure/configure.py#L203-L207
Likely this needs a check for the operating system.