Hello! How I can write to console process some input data? I try to process this code, but it not working. It run console program htpasswd, that generate password file for Apache. If run htpasswd in console, it two time ask the password: --------------------------------------------------- zz84@localhost:~$ htpasswd -c ~/mypassword.txt zz84 New password: Re-type new password: Adding password for user zz84 ---------------------------------------------------
Code beelow, and Im attach project file. ' Gambas module file PUBLIC hProcess AS Process PUBLIC password AS String = "mypassword" PUBLIC SUB Main() DIM path AS String = User.Home &/ "htpasswd.txt" IF Exist(path) THEN hProcess = SHELL Subst$("htpasswd &1 myUser", path) FOR READ WRITE AS "MyProcess" ELSE hProcess = SHELL Subst$("htpasswd -c &1 myUser", path) FOR READ WRITE AS "MyProcess" END IF END PUBLIC SUB MyProcess_Read() DIM sLine AS String READ #hProcess, sLine, -256 PRINT sLine IF (String.InStr(sLine, "New password:") > 0) OR (String.InStr(sLine, "Re-type new password:") > 0) THEN PRINT #hProcess, password END IF END
write-to-process.tar.bz2
Description: application/bzip-compressed-tar
signature.asc
Description: Эта часть сообщения подписана цифровой подписью
------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user