File Class

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

File Class

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:26 pm

by JADE Kid - Ray Hidayat >> Fri, 16 Jun 2000 6:39:42 GMT

Today, I was looking at making an instant messenger.
Now, I know that JADE is not designed for this, but the library system was getting boring!

So when I want a file transfer done, I needed to copy a file to the database.

Now the question is...
When I read a file, does it read on the computer which called the command, or the server?

Also, some new commands for the file class:
readAllBinary
readAllString

Then when I wanted to load a whole file in, I would just go:

file := _file.readAllBinary;

And it would work.

--
Ray Hidayat
JADE Kid - 2000
www.jadekids.com

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: File Class

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:26 pm

by Michael Jones >> Sun, 18 Jun 2000 20:48:12 GMT

-Today, I was looking at making an instant messenger

...-Now, I know that JADE is not designed for this, but the library system was

-getting boring!

Why not?

-So when I want a file transfer done, I needed to copy a file to the

-database.

-Now the question is...

- When I read a file, does it read on the computer which called the

-command, or the server?

It depends upon where the command is. If it is on a method called on the

server or a 'server execution' method it will happen on the server, if not it will happen

on the client. Currently I use the jade database as a temporary transport

mechanism when I want to transfer files between client and server in Jade,

does any one have a more efficent way of doing it, preferably without having

to store it in Jade database?

-Also, some new commands for the file class:

-readAllBinary

-readAllString

-Then when I wanted to load a whole file in, I would just go:

-file := _file.readAllBinary;

Does this achieve the same thing?

File.readBinary(File.length);

-And it would work.

--

Ray Hidayat

JADE Kid - 2000

www.jadekids.com

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: File Class

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:26 pm

by JADE Kid - Ray Hidayat >> Tue, 4 Jul 2000 21:37:23 GMT

Yes readBinary (file.fileLength) works, but it is just so annoying to use. I decided, why not have a loadFile method. You have loadPicture, why not have loadFile.
So there you have it. My opinions on loading files.

--
Ray Hidayat
JADE Kid - 2000
www.jadekids.com


Return to “Tips and Techniques”

Who is online

Users browsing this forum: Bing [Bot] and 24 guests