[lun jun 1 2020]
*** You have joined channel #lain [21:31]
*** Users on #lain: qorg11 @username
*** #lain modes: +nt
*** #lain was created on 2020-06-01 21:25:46
<qorg11> alright im back
*** username (user@vxempire.xyz) has quit: Remote host closed the connection
*** username (user@vxempire.xyz) has joined channel #lain
<username> accedentially closed emacs
<qorg11> lol
<qorg11> there's cat [21:32]
<qorg11> i think i can write wc
<username> got it
<username> i'm writing echo rn
<qorg11> isn't it hard?
<qorg11> just printf argvs lol
<username> no
<username> printf is hard
<username> echo is just looking for \n and stuff [21:33]
<qorg11> t.  vprintf
<qorg11> Are we going to add flags?  [21:34]
<qorg11> like -l for wc
<qorg11> because in that case, i have no idea how getopt works outside perl
<username> work on basics now
<username> add flags later
<qorg11> We aren't going to add cat -v are we
<username> no [21:36]
<username> cat -v considered harmful
<qorg11> yeah
*** username (user@vxempire.xyz) has quit: Remote host closed the connection
*** username (user@vxempire.xyz) has joined channel #lain
<username> accedentially quit emacs again B)
<qorg11> That doesn't happens with a tillingwm ;-)
<qorg11> btw i'm logging this chat for historic reasons, you mind?  [21:37]
<username> no, i dont care
<username> oh, check "man getopt"
<username> M-x man getopt
<qorg11> i know lol
<qorg11> i'm a bit brainlet idk if you knew that [21:38]
<qorg11> I'm going to create touch also
<username> Added echo
<username> https://gitlab.com/call-cc/k9core/-/blob/master/src/echo.c
<username> gnu are you even trying
<qorg11> lol [21:43]
<qorg11> probably no
<qorg11> liteally using touch with: open(argv[1],O_CREAT);
<username> virgin gnu echo vs chad k9core echo with 12 lines [21:44]
<username> virgin gnu cat vs chad k9core cat with 100 lines [21:45]
<qorg11> lol [21:46]
<qorg11> Is k9core an ironic project?  [21:47]
<username> not really
<qorg11> cool
<username> i think most coreutils suck
<username> even the openbsd ones
<username> some have too little options while some are too bloated
<qorg11> I can't understand why open O_CREAT is giving weird permissions
<qorg11> I skipped the chmod class!  [21:49]
<username> Fixed a single line in cat [21:50]
<qorg11> it worked but okay lol
<qorg11> Oh [21:51]
<qorg11> breakline
<username> wrote a 9 line pwd [21:57]
<qorg11> touch is having 4 headers, is that bloat?
<username> nah [21:58]
<qorg11> and 27 lines [21:59]
<qorg11> working now [22:00]
<qorg11> and could remove a header
<username> nice [22:01]
<username> send the commit
<qorg11> I'm going to push
<qorg11> don't do anything lol
<username> i added a bunch of commits [22:02]
<qorg11> sent
<qorg11> yes
<qorg11> i've been pulling
<qorg11> I know the code sucks ok [22:03]
<qorg11> pushing
<qorg11> pushed
<username> nice
<username> not bad code too [22:04]
<qorg11> >chmod
<qorg11> lmaoo
<qorg11> I think i can also write chmod
<qorg11> using the chmod function
<qorg11> >gnu coreutils 435 lines
<qorg11> jesus
<username> GNU's not bloated (i swear) [22:05]
<qorg11> lmao [22:06]
<qorg11> GNU PWD HAS 390 LINES
<username> HAHHAHHAHAH [22:07]
<username> LOL
<qorg11> Is this less bloated than plan9?
<qorg11> let's find out
<qorg11> We did it
<qorg11> my touch has less lines than 9base
<username> WE BEAT PLAN9 [22:08]
<username> UNIX WINS AGAIN
<qorg11> lmao
<username> I reccommend you pull
<qorg11> okay
<qorg11> okay this is the worst makefile i've ever seen, no offense [22:09]
<qorg11> why don't we generate it using autotools?  :)
<username> autotools is a bit shit ngl [22:10]
<username> i would say cmake but you probably will know my opinion on cmake
<qorg11> i like autotools [22:11]
<qorg11> but this is an antignu project
<qorg11> so we wouldn't use autotools
<qorg11> now i HATE cmake
<username> we could use some kind of ninja file generator
<username> or something like that
<qorg11> ninja?
<qorg11> nah
<qorg11> i can write my own makefile, don't worry
<username> nice
<qorg11> I remember i used ninja to build reactos [22:12]
<qorg11> btw
<qorg11> please verify my touch works in bsd
<qorg11> yeah [22:13]
<qorg11> probably your makefile is better
<qorg11> we can also do a shell script for building
<qorg11> for $file in
<qorg11> shit
<qorg11> for file in *c do
<username> touch works on bsd [22:14]
<qorg11> you know
<qorg11> ill think about it
<qorg11> is make.sh a good idea?
<username> yeah, probably
<qorg11> cool
<qorg11> rmdir(2) - delete a directory [22:15]
<qorg11> thank you POSIX
<qorg11> btw
<qorg11> C90 compliant or C99 is ok?  [22:16]
<username> C99
<qorg11> okay [22:17]
<qorg11> you can't do this in C90
<qorg11> for (int i = 0..)
<qorg11> btw [22:18]
<qorg11> isn't it ironic to compile this using gcc?
<username> i'm using clang LOL [22:19]
<qorg11> idk what's worse [22:20]
<qorg11> i think tcc would work
<username> behold, rmdir
<qorg11> I was writing it [22:21]
<qorg11> Ill do a change to it tohugh
<username> owned
<qorg11> oh
<qorg11> *argv deletes everything in the array?  [22:22]
<qorg11> or just argv[1]?
<username> just argv[1]
<qorg11> okay, then i'll use a for
<qorg11> btw, try not to use C++ comments [22:23]
<username> just did it though
<qorg11> lol
<username> for loop?  nah, while(*argv) { rmdir(*argv); *argv++; } [22:24]
<qorg11> I think for is more readable though
<username> more overhead in a for loop [22:25]
<qorg11> Thank you for following the code style in rmdir.c though
<qorg11> Hey, mine has less lines!  [22:26]
<qorg11> There's only one way to see which is best.
<username> my code works [22:28]
<username> really fast, infact
<qorg11> well
<qorg11> yours and mine are exactly the same fast
<qorg11> BUT [22:29]
<qorg11> mine has no warnings )=
<qorg11> =)*
<username> gcc is wrong thpo
<username> *tho
<qorg11> I'm using flycheck
<qorg11> it uses clang
<username> yeah mine produces a warning too [22:30]
<qorg11> Mine does?
<username> no
<qorg11> So we use mine or keep yours?  [22:31]
<username> send code on paste
<qorg11> of mine?
<username> paste.debian.net
<username> yeah
<qorg11> service unaviable
<qorg11> rip
<username> dang
<qorg11> WAIT [22:32]
<qorg11> we should at the -1 thing
<qorg11> let me do it
<qorg11> that would include stdio.h [22:34]
<username> check posix [22:35]
<qorg11> posix?
<username> check the posix standards
<qorg11> just did that
<qorg11> I can also use if(rmdir(argv[i]) == -1) though [22:36]
<qorg11> but i think that's ugly as fuck and should never be used
<username> nah that's good C
<username> which is kinda weird but yeah that's how you write in C [22:37]
<qorg11> yes it is good c
<qorg11> but idk how readabl [22:38]
<qorg11> do i use the "file descriptor" or not?
<username> yeah [22:39]
<qorg11> okay
<qorg11> it should not return 1 right?
<username> yup
<qorg11> Error removing dir d
<qorg11> Error removing dir f
<qorg11> Error removing dir ds
<qorg11> Error removing dir dsa
<username> nvm running rmdir without that returns an error [22:40]
<qorg11> yeah [22:41]
<qorg11> rmdir should not give up at the first
<qorg11> for example
<qorg11> if foo directory exist but bar doesnt
<qorg11> and you run
<qorg11> ./rmdir bar foo
<qorg11> it wont delete foo
<username> add to an errors count and print that amount of errors at the end
<username> if(err) { errors++; }
<qorg11> by err you mean fd == -1?
<qorg11> i pushed though [22:43]
<username> for(int i = 0; i < errors; i++) { print("File or directory not
found"); }
<username> nice
<qorg11> if(errors>0) [22:44]
<qorg11> {
<qorg11> printf("%i errors found",errors);
<qorg11> }
<qorg11> like that?
<qorg11> in the fd == -1 block it has an error++
<username> yeah
<qorg11> okay [22:45]
<username> i'm gonna go for a bit
<qorg11> see ya
<qorg11> think im going to write rm too
<qorg11> with -r flag
<qorg11> stdio's remove [22:46]
<qorg11> I'll take a rest though [22:48]
<qorg11> I'll make a mirror in my github and git.qorg11.net
<qorg11> https://software.kill-9.xyz/k9core [23:05]
<qorg11> should we write man pages?  [23:38]
<qorg11> or gnu info?  ;)
<username> man pages [23:43]
<qorg11> the GNU thing was a joke
<qorg11> ill publish the irc logs in software.kill-9.xyz/k9core/logs
<qorg11> Every day at 00:00 spanish timezone
<username> sounds great
<qorg11> yeah [23:44]
<qorg11> there is not copy function!
<qorg11> oh well
<qorg11> we will just use read()
<qorg11> and write() somewhere ese
<qorg11> else
<qorg11> same thing with mv
<qorg11> but use remove() at the end
<qorg11> idk if read() can copy a big file though [23:45]
<qorg11> I can't understand something [23:47]
<qorg11> how does read() works?
<username> M-x man read
<qorg11> i knw
<qorg11> but like wtf
<qorg11> you odn't pass a reference to the buffer
<qorg11> as buffer*
<username> I dont think read is in FreeBSD
<qorg11> although the prototype is ssize_t read(int fd, void *buf, size_t
<qorg11> man 2 read [23:48]
<qorg11> syscalls are in .2 manpages
<username> bsd prototype is
<username> ssize_t
<qorg11> so is gnu's
<username> read(int fd, void *buf, size_t nbytes);
<qorg11> same as gnu [23:49]
<qorg11> ssize_t read(int fd, void *buf, size_t count);
*** username (user@vxempire.xyz) has left channel #lain: ERC (IRC client for
Emacs 26.3)
*** username (user@vxempire.xyz) has joined channel #lain [23:50]
<username> hello, accedentially left
<qorg11> yeah lol
<qorg11> how do you accidentally leave?
<qorg11> I literally have an M-x emacs uptime of 3 hours
<username> tried to C-k on another buffer
<qorg11> oh
<username> forgot which buffer i was C-k-ing [23:51]
<qorg11> I use C-x k
<qorg11> so i can't accidentally kill a buffer
<username> I use C-x k too, i just didn't notice the buffer highlight
<qorg11> oh [23:54]
<qorg11> do you use C-x 5?
<username> No, what does it do?  [23:55]
<qorg11> make another emacs frame
<qorg11> or window
<qorg11> try C-x 5 2
<username> oh, dang
<username> nic3
<qorg11> close it with C-x 5 0 [23:56]
<qorg11> C-x C-c will kill your emacs session
<qorg11> https://kill-9.xyz/emacs/1_Introduction/2_Files
<qorg11> C-x 5 f (find-file-other-frame): This opens another Emacs window2
puts the selected file on a new buffer.
<qorg11> This is not a new Emacs run, it is called a “frame” These two emacs
window shares the opened buffers.↩
<username> I know about frames [23:59]
<username> I just didnt' know about frame manipulatin
<qorg11> oh