Skip to content

Instantly share code, notes, and snippets.

@dhcgn
Last active January 29, 2024 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhcgn/6680391391e153bd4079f1db6bc19227 to your computer and use it in GitHub Desktop.
Save dhcgn/6680391391e153bd4079f1db6bc19227 to your computer and use it in GitHub Desktop.
Round 0
Testing Proton...
Testing Google Drive...
Testing OneDrive...
Testing Mega...
Round 1
Testing Proton...
Testing Google Drive...
Testing OneDrive...
Testing Mega...
Round 2
Testing Proton...
Testing Google Drive...
Testing OneDrive...
Testing Mega...
Round 3
Testing Proton...
Testing Google Drive...
Testing OneDrive...
Testing Mega...
Round 4
Testing Proton...
Testing Google Drive...
Testing OneDrive...
Testing Mega...
Round 5
Testing Proton...
Testing Google Drive...
Testing OneDrive...
Testing Mega...
Round 6
Testing Proton...
New-Object: test_cloud_strorage.ps1:40:14
Line |
40 | … $f = new-object System.IO.FileStream $filename , Create, ReadW …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling ".ctor" with "3" argument(s): "The process cannot access the file 'C:\Users\______\Proton Drive\______\My files\testing\test.bin'
| because it is being used by another process."
Testing Google Drive...
Testing OneDrive...
Testing Mega...
Round 7
Testing Proton...
Testing Google Drive...
Testing OneDrive...
Testing Mega...
Round 8
Testing Proton...
Testing Google Drive...
Testing OneDrive...
Testing Mega...
Round 9
Testing Proton...
Testing Google Drive...
Testing OneDrive...
Testing Mega...
$tests = @(
@{
n = "Proton"
f = "C:\Users\*\Proton Drive\*\My files\testing\test.bin"
},
@{
n = "Google Drive"
f = "G:\*\testing\test.bin"
},
@{
n = "OneDrive"
f = "C:\Users\*\OneDrive\testing\test.bin"
},
@{
n = "Mega"
f = "C:\Users\*\Mega\testing\test.bin"
}
)
function createtestdata {
$result = ""
for ($i = 0; $i -lt 1024 * 10; $i++) {
$result += (New-Guid).ToString()
}
$result = [System.Text.Encoding]::UTF8.GetBytes($result)
return $result
}
for ($i = 0; $i -lt 10; $i++) {
Write-Host "Round $i"
$testdate = createtestdata
foreach ($test in $tests) {
Write-Host " Testing $($test.n)..."
$filename = (Get-ChildItem $test.f).FullName
$f = new-object System.IO.FileStream $filename , Create, ReadWrite
if(-not $?) {
continue
}
$f.Write($testdate, 0, $testdate.Length)
$f.Close()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment