Author Topic: Create large files FAST!  (Read 5165 times)

0 Members and 1 Guest are viewing this topic.

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Create large files FAST!
« Reply #15 on: January 30, 2021, 11:04:34 pm »
Let's find out
Shuwatch!

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: Create large files FAST!
« Reply #16 on: January 30, 2021, 11:12:07 pm »
Set a timer to see how long it takes. My drive is only 500GB

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Create large files FAST!
« Reply #17 on: January 30, 2021, 11:12:44 pm »
Then do it as (1024 ^ 4)/2
Shuwatch!

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: Create large files FAST!
« Reply #18 on: January 30, 2021, 11:14:43 pm »
I'm actually less than 500GB because of other files.

To make it worthwhile, the test should be for the terabyte file. If  wait 2 hours, might as well wait 4 hours
« Last Edit: January 30, 2021, 11:16:33 pm by NOVARSEG »

Offline SpriggsySpriggs

  • Forum Resident
  • Posts: 1145
  • Larger than life
    • View Profile
    • GitHub
Re: Create large files FAST!
« Reply #19 on: January 30, 2021, 11:17:47 pm »
Let me know how it goes
Shuwatch!

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: Create large files FAST!
« Reply #20 on: January 30, 2021, 11:20:54 pm »
My comp can't handle it. If anyone wants to try this, then you might be the first to do so.

Be careful the code might crash your computer.
« Last Edit: January 30, 2021, 11:22:45 pm by NOVARSEG »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Create large files FAST!
« Reply #21 on: January 30, 2021, 11:21:57 pm »
Or, if you want to create a whole lot of empty space in an operating system, consider building a politician, instead.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: Create large files FAST!
« Reply #22 on: January 30, 2021, 11:25:43 pm »
Maybe, but a single  "A" at the end of a terabyte file is an amazing thing.
« Last Edit: January 30, 2021, 11:26:48 pm by NOVARSEG »

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Create large files FAST!
« Reply #23 on: January 30, 2021, 11:35:51 pm »
So why not just go the extra steps? Add a dash and a hole, and viola, ya got yourself a politician.
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: Create large files FAST!
« Reply #24 on: January 30, 2021, 11:59:40 pm »
Steve has successfully created the world's first terabyte file in 22 minutes.

https://www.qb64.org/forum/index.php?topic=3579.0
« Last Edit: January 31, 2021, 12:03:08 am by NOVARSEG »

Offline luke

  • Administrator
  • Seasoned Forum Regular
  • Posts: 324
    • View Profile
Re: Create large files FAST!
« Reply #25 on: January 31, 2021, 04:17:53 am »
Meanwhile on Linux:
Code: [Select]
# Create file with size 1TiB
~$ dd if=/dev/zero of=testfile bs=1TiB seek=1 count=0 status=none
# Append 'A' to the end of the file
~$ echo A >> testfile
# Confirm size: 1.1TiB
~$ ls -lh testfile
-rw-r--r-- 1 luke luke 1.1T Jan 31 20:13 testfile
# Print last 2 bytes of file
~$ tail -c 2 testfile
A
And it all ran in less time than it takes to blink.

https://en.wikipedia.org/wiki/Sparse_file is a little bit of magic.

Offline Petr

  • Forum Resident
  • Posts: 1720
  • The best code is the DNA of the hops.
    • View Profile
Re: Create large files FAST!
« Reply #26 on: January 31, 2021, 04:41:58 am »
The space on harddrive was removed immediately, but the program remained running and the hard drive was running at full speed :), wrote this new file at an average speed of 130 megabits per second.


Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Create large files FAST!
« Reply #27 on: January 31, 2021, 05:09:52 am »
Steve has successfully created the world's first terabyte file in 22 minutes.

https://www.qb64.org/forum/index.php?topic=3579.0

First terabyte file?  What?  Are you living in the 90s??

I've got databases of stuff archived now that are sitting around 4.2TB of space on my drive, and I'm just a home storage junkie.  I imagine that there's businesses and such out there somewhere that have petabytes of stuff archived.  We passed the realm of 20MB hard drives over three decades ago.  The world has moved on since QBASIC -- it's a QB64 existence now!

If all you have is 500MB of storage, you might want to go out and get something like: https://www.amazon.com/Seagate-Portable-External-Hard-Drive/dp/B088S5HDTV

10TB drive for between $150 and $200, and if you catch them on sale (or refurbished), you can get them for about half that price.  I used to have 5 hard drives with between 2 and 4TB of storage on them, but I was running out of room and upgraded recently to running 5 external 16TB drives.  I figure 80TB should handle my needs for the next several years, and by then, they'll probably have much larger systems that I can invest in for a reasonable set of prices. 

Give the world another 20 years, and TBs of storage is going to be laughed at, much like GBs of it is now.  :P
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!

Offline Pete

  • Forum Resident
  • Posts: 2361
  • Cuz I sez so, varmint!
    • View Profile
Re: Create large files FAST!
« Reply #28 on: January 31, 2021, 11:32:46 am »
One real life example, that guy Jared, from Subway. He had a petabyte hard drive, completely filled by a peta-file.

So here's a non-funny take on it. What do you guys suppose apps like CCleaner use when they perform a disk cleaning? In other words, does anyone know if the system actually overwrites the data, still on the hard drive, with a simple program like this one it it were to also calculate the disc free space, and use that as the file size of the empty file. I would think that might be possible, so one would not have to write characters to the entire disk. I would be assuming the blank spaces would have to somehow overwrite the existing non-indexed data. Does it rally work that way? No biggie, not something I need, but this just got me curious as to how people who make these cleaning apps approach the situation.

Pete
Want to learn how to write code on cave walls? https://www.tapatalk.com/groups/qbasic/qbasic-f1/

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
Re: Create large files FAST!
« Reply #29 on: February 01, 2021, 03:08:33 am »
@Pete

Only a single byte is written to the end of the file, all the other bytes remain the same.