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

what is the file extension esq in your makefile? #3

Open
adshz opened this issue Dec 7, 2023 · 2 comments
Open

what is the file extension esq in your makefile? #3

adshz opened this issue Dec 7, 2023 · 2 comments

Comments

@adshz
Copy link

adshz commented Dec 7, 2023

Hi

Thanks for making this tester file;

I tried to learn from your tester program where I noticed you use .esq in

  1 exec: $(SRC)
10          @$(CC) -o t0.esq $^ $(CFG) -D BUFFER_SIZE=0                                             
  1         @$(CC) -o t1.esq $^ $(CFG) -D BUFFER_SIZE=1
  2         @$(CC) -o t2.esq $^ $(CFG) -D BUFFER_SIZE=2
  3         @$(CC) -o t42.esq $^ $(CFG) -D BUFFER_SIZE=42
  4         @$(CC) -o t42000.esq $^ $(CFG) -D BUFFER_SIZE=42000
  5         

I couldn't find anywhere to understand what that meant. Is there any chance you could explain it a bit?

Many thanks!
David

@kodpe
Copy link
Owner

kodpe commented Dec 8, 2023

Hello David,

I read my code and I laughed a lot.

With the use of the dangerous rm -rf command, using an unlikely arbitrary
name was my solution I found at the time to avoid deleting files that
weren't mine. My code is bad, I should use /tmp for my temporary files, and
check whether or not the names I choose exist before using them.

Extensions are never reliable. Don't look at extensions. They're just for
humans. You can create an executable with a .shrdlu or .png extension or
whatever you want, nothing is the convention on Unix, .exe on Windows.

Unlike Windows, Unix generally doesn't use extensions, but analyzes the
contents of the file to determine its type. You can do the same to find out
what a file really is with this command

file <path>

Looking for all special and limit cases (corner points), doing my own tests
and automation scripts has helped me a lot in my common core. I read your
school project notes on github. I like your mindset.

Kodp

@adshz
Copy link
Author

adshz commented Dec 14, 2023

Hello David,

I read my code and I laughed a lot.

With the use of the dangerous rm -rf command, using an unlikely arbitrary name was my solution I found at the time to avoid deleting files that weren't mine. My code is bad, I should use /tmp for my temporary files, and check whether or not the names I choose exist before using them.

Extensions are never reliable. Don't look at extensions. They're just for humans. You can create an executable with a .shrdlu or .png extension or whatever you want, nothing is the convention on Unix, .exe on Windows.

Unlike Windows, Unix generally doesn't use extensions, but analyzes the contents of the file to determine its type. You can do the same to find out what a file really is with this command

file <path>

Looking for all special and limit cases (corner points), doing my own tests and automation scripts has helped me a lot in my common core. I read your school project notes on github. I like your mindset.

Kodp

Hi Kodp,

Thanks for reply. Aw sweet, I think we all have that moment: feeling cringe about our own code. But I think it is great as I don't know much about shell scripts. For example, I saw your sq_main.c using command line argument. (i.e. int ac, char *av[]) and I thought it should be just for BUFFER_SIZE. Yet, I saw you hard code for eachBUFFER_SIZE` then I was a bit disconnect. It would be great if you can let me know how each file works.

I would love to know more about how you design the tests so I am able to write it on my own. I am still learning about your test shell script. Hence, I was confused to see the extension.

To be honest, I don't know much about why using /temp is better. why do you think it is a better idea?

In terms of corner points, I also love to know why you pick up those buffer size too.

Best,
David

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants