+ 1
root access
when I try this int main() { system("whoami"); return 0; } the output is : root do I have root access, I am a bit confusing plus can anyone explain how the files get deleted automatically after the end of the program meaning when I type system("touch file.txt"); a file name "file.txt" will be created, and after running the program once again with system("ls"); the file is no longer there, I mean this is possible but just wondering how?
10 Réponses
+ 5
Sololearn runs programs as root. Yet that doesn't help you much since the filesystem is largely read-only and the whole container will replaced every time someone executed a program. So you can't store data between two executions of your program.
+ 1
no I'm just trying to understand how files you create within the terminal deleted automatically
BTW you can compile a file.txt in c++ if you specify that "file.txt" is a c++ to the compiler u can do it by
g++ -x c++ file.txt
+ 1
Tell me plz. Is your programm file.c compiled and works?
Why you are not trying syscall?
+ 1
cheked your prog. It's work.
+ 1
yes, my question wasn't about c++
I'm trying to understand how SoloLearn server works.
you can do: system("ls") and discover
0
Waite a minute i try your code
0
Tell me plz, are You trying run C Program from file. txt?
If so. Dont try. Nothing Will be done.
0
I see. Ok. Its intresting to explore how SoloLearn server works. I want to understand this too.
0
exactly 🤗