Re: /dev/tcp
"Carlos E.R." <[email protected]>
| Newsgroups | comp.os.linux.misc |
|---|---|
| Organization | Tebibyte_Retro_Gaming |
| Message-ID | <[email protected]> |
On 2026-08-24 06:31, c186282 wrote: > On 8/23/26 07:50, Carlos E.R. wrote: >> On 2026-08-23 09:37, c186282 wrote: >>> On 8/23/26 00:01, Rich wrote: >>>> vallor <[email protected]> wrote: >>>>> At Thu, 20 Aug 2026 23:30:40 -0000 (UTC), Lawrence D’Oliveiro >>>>> <[email protected]> wrote: >>> ANYway, /dev/tcp does have uses. It's worth exploring. >>> Maybe YOU can find a use to suit YOUR needs/desires. >>> I used it for a custom disk-scan/wipe app (had to >>> use a 'C' module because huge track/cluster/byte numbers >>> were needed for modern mag drives - the main app was >>> in Lazarus for the pretty display and buttons). >>> >>> Note Lazarus/FPC *says* it supports huge seek numbers >>> but DOESN'T ... limited to maybe 4gb. >> >> I wrote a program that writes bytes on big partitions. >> >> >> excerpted: >> >> const >> sourcefilename = './BigRandom'; >> rawdest: string = ''; // example: '/dev/sda11' >> >> shuflecount = 1024; >> arraysize = 1023; >> ChunkSz=1048576; >> type >> tCacho= array [1..ChunkSz] of byte; >> >> var >> Fin, Fout: file of tCacho; >> gotresult: Word; >> >> BigData : array [1..shuflecount] of tCacho; >> OutputIndex : Int64; // counts MiB written. >> >> >> begin >> >> // writes one MiB >> {$I-}write(Fout,BigData[RandomIndex]);{$I+} >> gotresult:= ioresult; >> >> >> The purpose of the program is to fast fill a partition or disk with >> nearly true random data. It is as fast as dd could be. > > Um ... how many GB could that cope with ? I have done entire disks sized terabytes. But I don't actually use "seek". > > 'Seek' counts can sometimes be supplimented > by an 'offset' value - so basically you're > getting the mult of two doubles. I didn't > do it that way, and thus needed very large > sector/track/cluster integers. An external 'C' > pgm using really large integer types was needed. Can you seek not a byte, but a record or array? Seek(var F; N: Int64) File can be a file of some variable that is not a byte. And type Int64 = - 9223372036854775808..9223372036854775807; (why signed?) Why not QWord? type QWord = 0..18446744073709551615; > Anyway, it worked. > > My app could ALSO just LOOK at data, kinda put > it into a "ghex"-looking sidebar (but with > ASCII translation if possible). So you could > just look, OR zap. Anyway, nothing TOO complex > aside from the sheer size of modern mag disks. > > As useful utility. I encourage people to write > their own. > > DID add one odd, maybe questionable, feature ... > you could spec on the CL x-number of gigs to > TOTALLY wipe at the beginning ... and then > a couple numbers for "shotgun" blasting of > later tracks. Most of the file-table/system > stuff tends to be early on, and data with > holes in it is "less useful". This made the > "wipes" much faster. > -- Cheers, Carlos. ES🇪🇸, EU🇪🇺;