GetVolumeInfo on AmigaOS

Report any Hollywood bugs here
Post Reply
User avatar
jPV
Posts: 604
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

GetVolumeInfo on AmigaOS

Post by jPV »

I came up with couple of issues with the GetVolumeInfo() function on both AmigaOS 3 and 4. They probably aren't bugs per se, but maybe they could be "fixed" in Hollywood anyway?


1) Ram Disk: (and stuff that points there like T:) seem to give 0 bytes as free space with GetVolumeInfo() on AmigaOS. On MorphOS this doesn't happen and you get the size of the available memory as a result. This probably is a small implementation difference in operating systems itself, but could this be handled in Hollywood somehow so that you could get the real free space on AmigaOS too?


2) GetVolumeInfo seems to have some size limitation under AmigaOS versions. Maybe at 2GB? On MorphOS this isn't an issue and there you can get correct sizes even with bigger partitions. Anyway, AmigaOS versions seem to give negative etc arbitrary values.

I used this code to test on different systems:

Code: Select all

@DISPLAY {Hidden=True}
Repeat
    Local vol$ = PathRequest("Select a volume")
    If vol$
        Local space = GetVolumeInfo(vol$, #FREESPACE)
        ConsolePrint("Volume", vol$, "has", space, "bytes free space.")
    Else
        End
    EndIf
Forever
And here's a result on my AmiKit (WinUAE) installation:

Code: Select all

5.AmiKit:> info AK0: AK1: RAM:
Unit    Size    Used    Free Full Errs   State    Type    Name
AK0:    3.9G  936.6M    3.0G  23%    0 read/write SFS0    AmiKit
AK1:   99.0G   35.9G   63.1G  36%    0 read/write OFS     RabbitHole
RAM:     22K     22K      0K 100%    0 read/write OFS     Ram
5.AmiKit:> Ram:getvolumeinfotest.68k 
Volume AK0: has -1085353472 bytes free space.
Volume AK1: has -969785344 bytes free space.
Volume RAM: has 0 bytes free space.
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: GetVolumeInfo on AmigaOS

Post by airsoftsoftwair »

jPV wrote: Mon Feb 10, 2020 5:00 pm 1) Ram Disk: (and stuff that points there like T:) seem to give 0 bytes as free space with GetVolumeInfo() on AmigaOS. On MorphOS this doesn't happen and you get the size of the available memory as a result. This probably is a small implementation difference in operating systems itself, but could this be handled in Hollywood somehow so that you could get the real free space on AmigaOS too?
That's just how AmigaOS behaves I guess. Remember that on classic Amigas the RAM disk was always shown as being 100% full? Of course, Hollywood could work around this by intercepting GetVolumeInfo() queries to RAM Disk...
jPV wrote: Mon Feb 10, 2020 5:00 pm 2) GetVolumeInfo seems to have some size limitation under AmigaOS versions. Maybe at 2GB? On MorphOS this isn't an issue and there you can get correct sizes even with bigger partitions. Anyway, AmigaOS versions seem to give negative etc arbitrary values.
Ok, this looks like a bug. Will be fixed.
User avatar
airsoftsoftwair
Posts: 5446
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: GetVolumeInfo on AmigaOS

Post by airsoftsoftwair »

Code: Select all

- Fix [OS3]: GetVolumeInfo() returned negative values when used with partitions that are bigger than 2 GB
Post Reply