I have a brand new C++ class to open processes using pipes, fork and exec. The only issue I have is when I write the lines readed from the 'stdout' pipe using fgets. Executing the command
each line is written with
yes, I also have an EBADF error, the code is still a mess. It seems that the console want a '\r\n' instead of a '\n'. Anyone for an hint?
ls -lohAFGH -D %Y.%m.%d %H:%M /usr/local
I get
Code:
total 236
drwxr-xr-x 5 root wheel - 45K 2014.03.15 14:08 bin/
drwxr-xr-x 2 root wheel - 512B 2014.03.06 18:45 env/
drwxr-xr-x 43 root wheel - 1.5K 2014.03.15 14:08 etc/
drwxrwxr-x 11 root wheel - 512B 2013.10.06 02:55 freethread/
drwxr-xr-x 5 root wheel - 512B 2014.01.26 19:59 freethread.local/
drwxr-xr-x 287 root wheel - 36K 2014.03.13 20:14 include/
drwxr-xr-x 4 root wheel - 2.0K 2014.03.11 14:00 info/
drwxr-xr-x 79 root wheel - 81K 2014.03.13 20:14 lib/
drwxr-xr-x 3 root wheel - 512B 2014.03.03 05:21 lib32/
drwxr-xr-x 8 root wheel - 512B 2014.03.03 17:23 libdata/
drwxr-xr-x 10 root wheel - 2.5K 2014.03.11 13:59 libexec/
drwxr-xr-x 49 root wheel - 1.0K 2014.03.07 20:59 man/
drwxr-xr-x 23 root wheel - 512B 2014.03.03 14:18 netbeans-7.4/
drwxr-xr-x 9 root wheel - 512B 2014.03.13 02:54 openjdk6/
drwxr-xr-x 9 root wheel - 512B 2014.03.06 22:15 openjdk7/
drwxr-xr-x 2 root wheel - 1.0K 2014.03.07 20:43 sbin/
drwxr-xr-x 154 root wheel - 3.0K 2014.03.15 00:45 share/
drwxr-xr-x 2 root wheel - 512B 2014.03.03 01:28 tests/
drwxr-xr-x 2 root wheel - 512B 2014.03.03 01:28 www/
drwxr-xr-x 4 root wheel - 512B 2014.03.03 03:48 x86_64-portbld-freebsd10.0/
OUT ERROR: 9
>>> Unimplemented
each line is written with
Code:
cout << s;
yes, I also have an EBADF error, the code is still a mess. It seems that the console want a '\r\n' instead of a '\n'. Anyone for an hint?