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

BUG - (Windows) Shell commands / interactions not compatible #279

Open
AljenU opened this issue Nov 5, 2021 · 0 comments
Open

BUG - (Windows) Shell commands / interactions not compatible #279

AljenU opened this issue Nov 5, 2021 · 0 comments
Labels

Comments

@AljenU
Copy link
Collaborator

AljenU commented Nov 5, 2021

Most interactions with a shell are not 1-to-1 interchangeable between unix and windows.

Shell interactions happen through functions system, unix and dos, and within AA also aas_shell. They can also happen by having lines of code in the m file starting with a !.

In AA, aas_shell is a dedicated wrapper function around a system call. However, the system function is also used without the aas_shell wrapper in multiple places.

Fixes:

  • Preferably, use a matlab provided function instead of doing a shell interaction.
    Example: use mkdir(dirpath) instead of system(sprintf('mkdir %s', dirpath). This also allows for better success checking.
  • If there is no matlab provided alternative, have a dedicated aa wrapper function for often-occurring shell interactions.
  • Have a dedicated version of the command for use on windows.
  • Additionally, make sure all shell interaction goes through aas_shell. And there have an extra input is_pc_safe, default false, to indicate that a command provided to aas_shell has been checked for windows compatibility. If not, throw an error on windows, so as not to execute unchecked code.
@AljenU AljenU added the bug label Nov 5, 2021
AljenU added a commit to AljenU/automaticanalysis that referenced this issue Nov 10, 2021
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

1 participant