Home  
Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
4 user(s) are online (4 user(s) are browsing Forums)

Members: 0
Guests: 4

more...
Support us!
Recent OS4 Files
OS4Depot.net





Sfs and files +4gig
Home away from home
Joined:
2006/11/30 18:43
From Norway
Posts: 2416
To make a program handle such large files,are there any specail commands needed?? Or can you just use standard open and close commands(for files) with standard read and write commands???

_________________
Sam460 Lite
   Report Go to top

Re: Sfs and files +4gig
Just can't stay away
Joined:
2007/10/25 9:21
From Gothenburg / Sweden
Posts: 1102
@Antique

An example of problem i get with ctorrent and sfs/02 when downloading a +4gb file.

Ctorrent first makes the file 325mb big and after some DL it frequently puts out the messages

error, failed to seek to 18446744072280801280 on file "xbx.iso": Illegal seek
error, failed to seek to 18446744072280817664 on file "xbx.iso": Illegal seek
error, failed to seek to 18446744072280834048 on file "xbx.iso": Illegal seek
error, failed to seek to 18446744072280850432 on file "xbx.iso": Illegal seek
error, failed to seek to 18446744072280866816 on file "xbx.iso": Illegal seek
error, failed to seek to 18446744072280883200 on file "xbx.iso": Illegal seek
error, failed to seek to 18446744072280899584 on file "xbx.iso": Illegal seek

   Report Go to top

Re: Sfs and files +4gig
Quite a regular
Joined:
2007/2/23 13:49
From Finland, the land of Santa, sauna, sisu and salmiakki
Posts: 982
@Antique

Use ChangeFilePosition(), GetFilePosition(), GetFileSize(), ChangeFileSize() instead of old Seek() function. (Seek() is only 32bit and it's now deprecated. Those others are 64bit.) (Remember to use int64 variables with those.) Open(), Close(), Read() and Write() are still ok. (Well OS4 only. I don't know OS3.x.)

_________________
Extremely happy X1000 user. Be authentic.
"Anyone can build a fast CPU. The trick is to build a fast system." - Seymour Cray
AmigaOne X1000
   Report Go to top

Re: Sfs and files +4gig
Just can't stay away
Joined:
2006/12/1 19:07
From Germany
Posts: 1021
@Antique

Quote:
To make a program handle such large files,are there any specail commands needed?? Or can you just use standard open and close commands(for files) with standard read and write commands???
Open(), Close(), Read() and Write() are still the same, but for example most features of Seek() can't be used and ExAll() can't return file sizes > 4 GB.
Old software which only accesses files sequentially and doesn't check the file size works with large files, but that's not much, everything else has to be changed to use the new 64 bit AmigaOS4 dos.library functions, or the 64 bit C library functions. On AmigaOS 3.x you can use the functions in the dos64 link library from my homepage instead.

   Report Go to top

Re: Sfs and files +4gig
Home away from home
Joined:
2006/11/30 18:43
From Norway
Posts: 2416
@joerg

Ok. I'm working on a port to os4. I see it uses fseek and lseek. Seems like standard open close commands for file opening/closing. Not searched all files yet though!

But why can't the original commands be adjusted to work with big files without any changes to the commands itselves? if you understood that? :)

_________________
Sam460 Lite
   Report Go to top

Re: Sfs and files +4gig
Just can't stay away
Joined:
2006/12/1 19:07
From Germany
Posts: 1021
@Antique

Quote:
Ok. I'm working on a port to os4. I see it uses fseek and lseek.
You have to use fseeko64() and _lseek64() instead, but that requires a new SDK ...

Quote:
But why can't the original commands be adjusted to work with big files without any changes to the commands itselves? if you understood that? :)
Old functions like IDOS->Seek(), the C library fseek(), etc., use 32 bit arguments and return values for the offset, if you would change them to 64 bit you'd break all old software passing 32 bit values to them or expecting 32 bit return values. New functions with 64 bit arguments and/or return values, which are only used by new software, have to be used instead.

   Report Go to top

Re: Sfs and files +4gig
Not too shy to talk
Joined:
2006/12/8 18:02
From Germany
Posts: 389
@joerg

Is it possible to release 'only' a new newlib devkit, it should work with SDK 51.22, or not?

   Report Go to top

Re: Sfs and files +4gig
Just can't stay away
Joined:
2006/12/1 19:07
From Germany
Posts: 1021
@ZeroG

Quote:
Is it possible to release 'only' a new newlib devkit,
Since newlib is part of AmigaOS4, not just a contribution like for example SFS, only Hyperion can release updates.

Quote:
it should work with SDK 51.22, or not?
Except for the shared object support, which needs GCC 4.0.4 or newer, it should work.

   Report Go to top

Re: Sfs and files +4gig
Home away from home
Joined:
2006/11/30 18:43
From Norway
Posts: 2416
@joerg

Do you have any idea when a new update of sdk will come?

_________________
Sam460 Lite
   Report Go to top

Re: Sfs and files +4gig
Not too shy to talk
Joined:
2006/12/8 18:02
From Germany
Posts: 389
@joerg
Ok, I have expected something like that.

EDIT:
Maybe you could create a small link library that contains stubfunctions for the 64 bit filefunktions. Something like your libdos64, but for newlib. Its ugly, but it should help Antique with ctorrent.


Edited by ZeroG on 2008/4/14 20:52:18
   Report Go to top





[Advanced Search]


Powered by XOOPS 2.0 © 2001-2014 The XOOPS Project