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 


Appending contents in files

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


Joined: 09 Sep 2003
Posts: 3

PostPosted: Fri Dec 19, 2003 9:13 am    Post subject: Appending contents in files Reply with quote

Hi,

I would like to append the contents from several files into a new file, but I can't get it to work. The files can become quite large (up to 1Mb, maybe more)

I've been looking into BINFILE and @BINFILE but I cannot get it to work only looking in the helpfiles.

I did some work in VDS 3.5 a couple of years ago, but I still considder me a VDS newbee. I'm using the latest evaluation copy of VDS to see if I can solve the functionallity I am after.

Cheers,
Magnus
Back to top
View user's profile Send private message
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Dec 19, 2003 10:42 am    Post subject: Reply with quote

hi magnus,

you really need to show us the code that you have used to append the lists...folks will then be able to help you work out why it doesn't work

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


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

PostPosted: Fri Dec 19, 2003 11:26 am    Post subject: Reply with quote

Maybe the DOS command "copy" will do, using the right parameters? Or do you have to extract the files from the big file as well?
_________________
[ 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
Serge
Professional Member
Professional Member


Joined: 04 Mar 2002
Posts: 1480
Location: Australia

PostPosted: Fri Dec 19, 2003 2:46 pm    Post subject: Reply with quote

come to think of it...doesn't dos have a append command that appends 2 files together??!? i vaguely remember something like it...

if it did, you could use vds to run the dos append command with the right switches and parameters

serge

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


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

PostPosted: Fri Dec 19, 2003 2:54 pm    Post subject: Reply with quote

I think you mean something like this?

Code:
copy file1.exe+file2.exe+file3.exe output.exe

_________________
[ 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
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Dec 19, 2003 2:54 pm    Post subject: Reply with quote

Magnus wrote:
up to 1Mb, maybe more

IMO best bet is to use a dll like vdsug.dll to accomplish this as vds commands may not be able to handle such large files Question
http://www.vdsworld.com/index.php?page=download&fileid=262

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Fri Dec 19, 2003 4:06 pm    Post subject: Reply with quote

-
Unfortunately, the later versions of VDSug.dll have been
removed from VDSworld. The link CodeScript provided is
an old version that does NOT have file IO.

The latest (free) VDSug.dll version with file IO, draw.dll
functions and many other features can be downloaded
here:

http://www.trinex.net/users/mac/vdsug/

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Boo
Valued Contributor
Valued Contributor


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

PostPosted: Sat Dec 20, 2003 1:20 am    Post subject: Reply with quote

Hi Magnus,

Here is some example code you can use with Mac's excellent vdsug.dll to append a group of bitmap files that reside in the same folder. (In essence, the attached code is a basic resource compiler.)

You can shape the code to meet your needs (and use the offsets to extract the original files--if needed).

I set the buffer for 1 MB, but the buffer might need to be adjusted depending on file size... (If the total of all files is over 1 MB, then you'll need to "up" the buffer size.)

Cheers!

- Boo


Code:

#define command,ug
EXTERNAL @path(%0)vdsug.dll
%%bufsize = @ug(FILEREADBUFSIZE, 1000000)
file delete,@path(%0)myfile.dsr
%%offset = 0
%%offstring = 0
list create,4
list filelist,4,@path(%0)*.bmp
info @count(4) bitmap files will be appended to one file...
UG FILEOPEN, 1, @path(%0)myfile.dsr, READ|WRITE
repeat
%%next = @next(4)
if @null(%%next)
goto finish
end
UG FILEOPEN, 2, @shortname(%%next), READ|WRITE
%%size = @file(%%next,Z)
%%offset = @fadd(%%offset,%%size)
%%offstring = %%offstring|%%offset
UG FILEREAD, 2, RAWDATA, 0
%%size2 = @ug(FILEGETSIZE, 1)
%%newpos = @ug(FILESETPOS, 1, %%size2)
UG FILEWRITE, 1, RAWDATA, !BUFFER!
until @null(%%next)
:finish
info Here are the offsets for use in VDS as resources:@cr()@cr()%%offstring
UG FILECLOSE, 1
UG FILECLOSE, 2
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