> Hi everyone > > I'm doing a little webserver in Gambas. Everything is ok so far, but I'm > having a hard time dealing with binary files (like images). Is there a > way to read a file in a raw fashion? > > I've tried to do an OPEN file FOR READ, and using a "byte" variable as > buffer. But the bytes are read in this orden: 1, 0, 3, 2, 5, 4, 7, 6, > etc... I think it's something about the endiannes. > > Again, there is a way to read a file without any format constraints? > Thank you!!!!
If you want to serve some image files, you don't have to read it byte by byte. You just have to open it and sent it where it is needed. Print #DestinationFileOrSocket, File.Load(PathToBinaryFileOnTheServer); Do not forget the ";", otherwise a newline will be added! -- Benoît Minisini ------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA http://p.sf.net/sfu/rim-devcon-copy2 _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user