Pular para o conteúdo

(CLIPPER) Rodando o mesmo código tanto no Windows quanto no Linux

Responder tópico
  • Denunciar
  • Indicar

1. (CLIPPER) Rodando o mesmo código tanto no Windows quanto no Linux

Enviado em 09/04/2026 - 16:54h

Queria que o mesmo código rodásse Tanto no Windows quanto no Linux? Uma pergunta? Como faço isso?

PROCEDURE Main() 
LOCAL cArquivo := "https://www.ouka.com.br/meu_arquivo.txt";
IF SISTEMA_OPERACIONAL == "windows"
RUN ('cmd /c powershell -Command "Invoke-WebRequest -Uri ' + cArquivo + ' -OutFile x.txt"')
ELSEIF SISTEMA_OPERACIONAL == "linux"
RUN ("wget -O x.txt " + cArquivo)
ENDIF
RETURN


Responder tópico

2. Re: (CLIPPER) Rodando o mesmo código tanto no Windows quanto no Linux

Enviado em 11/04/2026 - 19:10h

PROCEDURE Main() 
LOCAL cArquivo := "https://www.ouka.com.br/meu_arquivo.txt";

IF SISTEMA_OPERACIONAL == "windows"
RUN ("cmd /c powershell -Command \"Invoke-WebRequest -Uri '" + cArquivo + "' -OutFile 'x.txt'\"")
ELSEIF SISTEMA_OPERACIONAL == "linux"
RUN ("wget -O x.txt " + cArquivo)
ENDIF
RETURN



_________________________________________________________
Rule number one: Always listen 'to' Buck!
Enquanto o cursor estiver pulsando, há vida!

3. Re: (CLIPPER) Rodando o mesmo código tanto no Windows quanto no Linux

Enviado em 15/04/2026 - 12:19h

Você me enviou um código errado!
Faça a correção no seu código!

4. Re: (CLIPPER) Rodando o mesmo código tanto no Windows quanto no Linux

Enviado em 15/04/2026 - 16:55h

Sim Senhor, desculpa Sinhozinho, o escravo não fez por mal.
É que a bola de ferro na canela atrapalha um pouco a concentração.

PROCEDURE Main() 
LOCAL cArquivo := "https://www.ouka.com.br/meu_arquivo.txt";

IF SISTEMA_OPERACIONAL == "windows"
RUN ("cmd /c powershell -Command \"Invoke-WebRequest -Uri '" + cArquivo + "' -OutFile 'x.txt'\"")
ELSEIF SISTEMA_OPERACIONAL == "linux"
RUN ("wget -O x.txt " + cArquivo)
ENDIF
RETURN



_________________________________________________________
Rule number one: Always listen 'to' Buck!
Enquanto o cursor estiver pulsando, há vida!

5. Re: (CLIPPER) Rodando o mesmo código tanto no Windows quanto no Linux

Enviado em 15/04/2026 - 17:11h

Qual é a função que retorna a variável

SISTEMA_OPERACIONAL

6. Re: (CLIPPER) Rodando o mesmo código tanto no Windows quanto no Linux

Enviado em 19/04/2026 - 01:11h

LOCAL SISTEMA_OPERACIONAL := Lower( OS() )
A função OS() retorna uma string contendo o nome do sistema operacional.
Lower é para para facilitar a comparação em minúsculas.


_________________________________________________________
Rule number one: Always listen 'to' Buck!
Enquanto o cursor estiver pulsando, há vida!

Responder tópico

Responder tópico

Entre na sua conta para responder.

Fazer login para responder