File Size

2018-01-14 Thread Wayne Stewart via 4D_Tech
Hi, I'm trying to create a method that will return a file size as a string, similar to how the Finder does. Although I get "a result" it's not the "same result" as reported in the Finder :( It turns out that in the Finder KB are 1000 bytes, MB are 1000 KB etc. I wasted a fair bit of time on

Re: File Size

2018-01-14 Thread Keisuke Miyako via 4D_Tech
KB = 1000 bytes KiB = 1<<10 bytes https://en.wikipedia.org/wiki/Kibibyte ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options:

Re: File Size

2018-01-14 Thread Wayne Stewart via 4D_Tech
Thanks Keisuke > The unit was established by the International Electrotechnical Commission (IEC) in 1998 My computer science degree predated that and I've never struck it before! You learn something new every day.

Re: File Size

2018-01-14 Thread Arnaud de Montard via 4D_Tech
> Le 15 janv. 2018 à 08:15, Arnaud de Montard via 4D_Tech > <4d_tech@lists.4d.com> a écrit : > > I use this (french "octet" stands for "byte") unit tests… ASSERT(Num_bytesToStr (MAXLONG^2)="4611,7 Po") ASSERT(Num_bytesToStr (MAXLONG*1000)="2,1 To") ASSERT(Num_bytesToStr (MAXLONG)="2,1 Go")

Re: File Size

2018-01-14 Thread Arnaud de Montard via 4D_Tech
> Le 15 janv. 2018 à 02:27, Wayne Stewart via 4D_Tech <4d_tech@lists.4d.com > > a écrit : > > Hi, > > I'm trying to create a method that will return a file size as a string, > similar to how the Finder does. I use this (french "octet" stands for "byte")