forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Binfile examples?

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Sun Nov 02, 2003 5:41 am    Post subject: Binfile examples? Reply with quote

Hi All,

I recently registered my copy of VDS 5.0 and have a question. Would it be possible for some of you to post some detailed Binfile examples? Also, a detailed example for the appending of files would be most welcome.

By the Way: Is there a way to set the buffer similar to the way you can when using the vdsug.dll?

Thanks,

Keith
Back to top
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Sun Nov 02, 2003 6:44 am    Post subject: Reply with quote

Well, this one doesn't write, but it reads.

[ GT-CheckForIcon ]
http://www.vdsworld.com/index.php?page=download&fileid=347

[ Preview ]
http://www.vdsworld.com/vdsscript.php?url=downloads/script/GT-CheckForIcon.dsc

-Garrett

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Sun Nov 02, 2003 9:03 am    Post subject: Reply with quote

This one appends:

Code:

  if @file(%%errlog)
    binfile open,1,%%errlog,append
  else
    binfile open,1,%%errlog,create
  end
  binfile write,1,text,@datetime(dd mmm yyyy hh:nn:ss)@tab()blah blah@cr()@lf()
  binfile close,1


(why is the indenting weird when I preview this?)

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Sun Nov 02, 2003 9:09 am    Post subject: Reply with quote

Jules, can you try to edit that message, and press Preview again? Cause if I make a post like that, the indenting is just like it is now... Confused
_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Sun Nov 02, 2003 3:11 pm    Post subject: Reply with quote

Thanks guys. Is there an easy way to append several files together?
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Nov 02, 2003 4:54 pm    Post subject: Reply with quote

If you're trying to combine several files you might want to look at the
DOS "copy" command (look towards the bottom at the colorized and bolded
text for what you're trying to do Wink ):

Quote:
Copies one or more files to another location.

COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/A | /B ] source [/A | /B]
[+ source [/A | /B] [+ ...]] [destination [/A | /B]]

source Specifies the file or files to be copied.
/A Indicates an ASCII text file.
/B Indicates a binary file.
/D Allow the destination file to be created decrypted
destination Specifies the directory and/or filename for the new file(s).
/V Verifies that new files are written correctly.
/N Uses short filename, if available, when copying a file with a
non-8dot3 name.
/Y Suppresses prompting to confirm you want to overwrite an
existing destination file.
/-Y Causes prompting to confirm you want to overwrite an
existing destination file.
/Z Copies networked files in restartable mode.

The switch /Y may be preset in the COPYCMD environment variable.
This may be overridden with /-Y on the command line. Default is
to prompt on overwrites unless COPY command is being executed from
within a batch script.

To append files, specify a single file for destination, but multiple files
for source (using wildcards or file1+file2+file3 format).

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Sun Nov 02, 2003 11:18 pm    Post subject: Reply with quote

Hi FreezingFire,

Yeppers, I am aware of DOS copy (but thanks). However, because some machines show a DOS window even when RUNH is used, I figured I would go another route.

FYI: I can successfully use the Binfile commands/functions. However, file size is limited. Apparently there is no way to up the buffer size (like you can do with the VDSUG. DLL). Larger files lock up my machine, and when splitting the data into smaller segments, it is quite slow (unlike VDSUG.DLL).

Thanks again,

Keith
Back to top
View user's profile Send private message
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Mon Nov 03, 2003 9:35 am    Post subject: Reply with quote

Skit3000 wrote:
Jules, can you try to edit that message, and press Preview again? Cause if I make a post like that, the indenting is just like it is now... Confused


If I edit it and press Preview, it still looks the same.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Mon Nov 03, 2003 9:47 am    Post subject: Reply with quote

keithglong wrote:
Hi FreezingFire,

Yeppers, I am aware of DOS copy (but thanks). However, because some machines show a DOS window even when RUNH is used, I figured I would go another route.

FYI: I can successfully use the Binfile commands/functions. However, file size is limited. Apparently there is no way to up the buffer size (like you can do with the VDSUG. DLL). Larger files lock up my machine, and when splitting the data into smaller segments, it is quite slow (unlike VDSUG.DLL).

Thanks again,

Keith


I'm puzzled by both these points. Perhaps if a DOS program has a PIF file that says to run normally it overrides the effect of RUNH?

The second point, I'm wondering how big the files are? My Search utility uses it to read in up to 1MB into a single variable in one go. The BINFILE command lacks any decent means of reading writing text files (e.g. a READLINE type of command) for the simple reason that you can load text files in to a list instead.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Protected
Valued Contributor
Valued Contributor


Joined: 02 Jan 2001
Posts: 228
Location: Portugal

PostPosted: Mon Nov 03, 2003 9:59 am    Post subject: Reply with quote

Yes, if you can tell us exactly what you want to do its easier =)
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Mon Nov 03, 2003 3:34 pm    Post subject: Reply with quote

Hi Jules,

Regarding your first question, your assumption is probably correct.

Regarding your second comment, I have not had any problems reading files. The problem seems to be in writing output. When writing binary files larger than 20K or so, the system becomes sluggish. (Text files write instantly, by the way.) I think the problem has to do with buffer size? Not sure.

What I want to do is open a large binary file, split it into three parts, and then make edits to each segment. Upon completion, I want to append the files back together. (I have not experienced problems writing strings to binary files. The problem seems to be when I output data for the creation of an entire binary file.)

Use of the VDSUG.DLL works fine. However, it would be nice to use the interal functions/commands within VDS in lieu of VDSUG.DLL (if at all possible).

Thanks guys,

Keith
Back to top
View user's profile Send private message
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Mon Nov 03, 2003 6:17 pm    Post subject: Reply with quote

jules wrote:
(why is the indenting weird when I preview this?)


Hmm.... this could be a problem with the style you're using. Occures this problem only when you're previewing a post?

EDIT: I used my admin-powers to see which style you're using Wink, and it's subSilver. Could you check if the indenting is right when viewing this topic: http://forum.vdsworld.com/viewtopic.php?t=1986

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
Vic D'Elfant
Past Contributor
Past Contributor


Joined: 26 Jun 2002
Posts: 673
Location: The Netherlands

PostPosted: Mon Nov 03, 2003 6:27 pm    Post subject: Reply with quote

NOTE: The [code:1:2b6bb90d0d] tag doesn't looks like it should at all styles other then subSilver. I'll update the other templates as soon as possible Smile

Regards,
Vic

_________________
phpBB Development Team
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Mon Nov 03, 2003 7:05 pm    Post subject: Reply with quote

keithglong wrote:
What I want to do is open a large binary file, split it into three parts, and then make edits to each segment. Upon completion, I want to append the files back together. (I have not experienced problems writing strings to binary files. The problem seems to be when I output data for the creation of an entire binary file.)

Use of the VDSUG.DLL works fine. However, it would be nice to use the interal functions/commands within VDS in lieu of VDSUG.DLL (if at all possible).

Thanks guys,

Keith


I think it's probably fair to say that BINFILE isn't very good for handling binary files because VDS isn't very good at dealing with anything but text. It converts each byte to numbers, either hex or decimal, unless you specify TEXT, in which case it converts all non printing characters (like CR, LF) to periods, which isn't a whole lot of use except for viewing the file. In the update, if you leave the type of input blank it will leave the non-printing characters unmolested, which is a slight improvement. But to be honest, if I wanted to handle binary files I'd probably choose to use an extension, such as the one you have already got.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Mon Nov 03, 2003 7:54 pm    Post subject: Reply with quote

Thanks Jules. That is what I shall do. Cool
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group