| View previous topic :: View next topic |
| Author |
Message |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Sun Nov 02, 2003 5:41 am Post subject: Binfile examples? |
|
|
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 |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Sun Nov 02, 2003 9:03 am Post subject: |
|
|
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 |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Sun Nov 02, 2003 3:11 pm Post subject: |
|
|
| Thanks guys. Is there an easy way to append several files together? |
|
| Back to top |
|
 |
FreezingFire Admin Team

Joined: 23 Jun 2002 Posts: 3508
|
Posted: Sun Nov 02, 2003 4:54 pm Post subject: |
|
|
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 ):
| 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 |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Sun Nov 02, 2003 11:18 pm Post subject: |
|
|
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 |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Mon Nov 03, 2003 9:35 am Post subject: |
|
|
| 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...  |
If I edit it and press Preview, it still looks the same. _________________ The Tech Pro
www.tech-pro.net |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Mon Nov 03, 2003 9:47 am Post subject: |
|
|
| 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 |
|
 |
Protected Valued Contributor


Joined: 02 Jan 2001 Posts: 228 Location: Portugal
|
Posted: Mon Nov 03, 2003 9:59 am Post subject: |
|
|
| Yes, if you can tell us exactly what you want to do its easier =) |
|
| Back to top |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Mon Nov 03, 2003 3:34 pm Post subject: |
|
|
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 |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Mon Nov 03, 2003 6:17 pm Post subject: |
|
|
| 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 , 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 |
|
 |
Vic D'Elfant Past Contributor


Joined: 26 Jun 2002 Posts: 673 Location: The Netherlands
|
Posted: Mon Nov 03, 2003 6:27 pm Post subject: |
|
|
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
Regards,
Vic _________________ phpBB Development Team |
|
| Back to top |
|
 |
jules Professional Member


Joined: 14 Sep 2001 Posts: 1043 Location: Cumbria, UK
|
Posted: Mon Nov 03, 2003 7:05 pm Post subject: |
|
|
| 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 |
|
 |
Boo Valued Contributor


Joined: 31 Oct 2003 Posts: 599 Location: Gulf Breeze, Florida USA
|
Posted: Mon Nov 03, 2003 7:54 pm Post subject: |
|
|
Thanks Jules. That is what I shall do.  |
|
| Back to top |
|
 |
|