View Single Post
Old 09 April 2024, 15:13   #50
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,300
Quote:
Originally Posted by meynaf View Post
It is negative if you think it is negative. Else it is 4294967295.
It is negative because dos/dos.h defines it to be a LONG. That's the interface. Yes, it's a silly interface, but that is the situation. It is documented to be a LONG and not a ULONG.



Quote:
Originally Posted by meynaf View Post
Normally a coder should know a file size is an unsigned number...
Normally a coder should use the system provided header files and not make assumptions.



Quote:
Originally Posted by meynaf View Post

Nothing will break, as long as big files are not used with such old software.
Except that all software on Amiga is "such old software". Again, if this would be a living vivid system, the situation would be somewhat different.


There are many possible ideas how to resolve such problems. One option is to encode the maximum LONG integer (0x7fffffff) and use that as indicator. Or use -1 as indicator. Or skip over such files when iterating over a directory. Or throwing an error in case such a file is examined with the old API (which is probably the most conservative approach avoiding too much breakage).


There are many possible approaches, each with drawbacks and advantages. I'm not happy with "shoot first" solutions.




Quote:
Originally Posted by meynaf View Post


Some file systems support names much larger than 30. This is when the problem happens : software reserves buffer for 30, and...
Sure.
Thomas Richter is offline  
 
Page generated in 0.07995 seconds with 11 queries