BetaArchive Logo
Navigation Home Screenshots Image Uploader Server Info FTP Servers Wiki Forum RSS Feed Rules Please Donate
UP: 26d, 21h, 38m | CPU: 32% | MEM: 5692MB of 10728MB used
{The community for beta collectors}

Forum rules


Any off topic discussions should go in this forum. Post count is not increased by posting here.
FTP Access status is required to post in this forum. Find out how to get it


Post new topic Reply to topic  [ 4 posts ] 
Author Message
 PostPost subject: C++ question        Posted: Mon Apr 27, 2009 1:08 am 
Reply with quote
Staff
User avatar
Offline

Joined
Wed Apr 11, 2007 2:11 pm

Posts
2607

Location
Germany, Earth

Favourite OS
Windows 10
I am currently working on a command-line application which reads the setup information files from MS-DOS and
Windows 3.x versions, scans them for X:YYYYYY.ZZZ (floppy drive, filename, extension) saves the results
in a text file and moves the files to folders. This is useful when you have any release which does not come on
floppy disc images (for example when it is from MSDN).

Here is an example:
Code:
    tutor     = "wintutor.exe "
    NetSetup  = FALSE
    MouseDrv  = TRUE
    Version   = "3.1.040"

; This is data needed by the MS-DOS half of setup so that it can copy the
; proper kernel and start Windows for the GUI portion of setup.
;
; ** MS-DOS documentation says that first byte of command line for 4a call
; ** should be space. ==> in execcmd RHS leave first space as it is now
[winexec]
    execstd   = "dosx.exe "
    execcmd   = " krnl286.exe /b /q:"
    exechimem = "xmsmmgr.exe"
    himemcmd  = ""
    Krnl386   = 2:krnl386.exe
    Krnl286   = 2:krnl286.exe
    dosx      = 2:dosx.exe

; Names of the disks Setup can prompt for.
[disks]
    1 =. ,"Microsoft Windows 3.1 disk #1",disk1
    2 =. ,"Microsoft Windows 3.1 disk #2",disk2
    3 =. ,"Microsoft Windows 3.1 disk #3",disk3
    4 =. ,"Microsoft Windows 3.1 disk #4",disk4
    5 =. ,"Microsoft Windows 3.1 disk #5",disk5
    6 =. ,"Microsoft Windows 3.1 disk #6",disk6
    7 =. ,"Microsoft Windows 3.1 disk #7",disk7
    8 =. ,"Microsoft Windows 3.1 disk #8",disk8

[oemdisks]
    Z =. ,"HP DeskJet Series v2.0 disk (z krabice s tisk├írnou, nebo od HP)",diskz

[user]
    4:setup.ini, noupdate

[windows]
    1:setup.hlp
    1:install.com
    1:setup.txt
    1:win.src,    Net
    1:system.src, Net
    1:winhelp.exe
    2:control.hlp
    2:GLOSSARY.HLP
    3:WINHELP.HLP

[windows.system]
    1:gdi.exe
    2:user.exe
    1:win.cnf
    1:lzexpand.dll
    2:ver.dll


Becomes this:
Code:
1:gdi.exe
1:install.com
1:lzexpand.dll
1:setup.hlp
1:setup.txt
1:system.src
1:win.cnf
1:win.src
1:winhelp.exe
2:GLOSSARY.HLP
2:control.hlp
2:dosx.exe
2:krnl286.exe
2:krnl386.exe
2:user.exe
2:ver.dll
3:WINHELP.HLP
4:setup.ini


So far, so good. Later I will create a function which moves the files into the respective folder and it is done.
But before I can do this I need some help. Since a lot of these setup files exist more than one time in the setup
file, they are also twice in the output list.

Does anyone have an idea how to read a textfile and delete double lines with C++?

_________________
MS vNext: Windows 10 ESD Database - Windows 10 Build Labs - Windows 10 Update Archive - Office 2016 Version Tracker - Office Downloader


Top  Profile  WWW
 PostPost subject: Re: C++ question        Posted: Mon Apr 27, 2009 5:26 am 
Reply with quote
FTP Access
User avatar
Offline

Joined
Fri Sep 01, 2006 10:04 pm

Posts
1022

Location
The Ephemeral between existance and non-existance: AKA "being"

Favourite OS
Rhapsody, BeOS
Reading files is rather trivial; you can find it on the dozens of pages such as this one http://www.fredosaurus.com/notes-cpp/io ... tfile.html

Although duplicates can be deleted with an O(N*N) cycle, consider using the Set collection structure - it may give you some more programing
practice.http://www.cplusplus.com/reference/stl/set/

_________________
Image
Part Time Troll - HPC Enthusiast - Spelling Master - Old Fart


Top  Profile  WWW
 PostPost subject: Re: C++ question        Posted: Mon Apr 27, 2009 5:55 pm 
Reply with quote
Donator
Offline

Joined
Tue Oct 17, 2006 8:26 pm

Posts
932
Or... you could use GNU grep and uniq.

No need to reinvent the wheel.


Top  Profile
 PostPost subject: Re: C++ question        Posted: Mon Apr 27, 2009 6:08 pm 
Reply with quote
Staff
User avatar
Offline

Joined
Wed Apr 11, 2007 2:11 pm

Posts
2607

Location
Germany, Earth

Favourite OS
Windows 10
Thanks for the answers, but I already found a solution... ^^

_________________
MS vNext: Windows 10 ESD Database - Windows 10 Build Labs - Windows 10 Update Archive - Office 2016 Version Tracker - Office Downloader


Top  Profile  WWW
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 




Who is online

Users browsing this forum: No registered users and 7 guests


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

Jump to:  

All views expressed in these forums are those of the author and do not necessarily represent the views of the BetaArchive site owner.

Powered by phpBB® Forum Software © phpBB Group

Copyright © 2006-2018

 

Sitemap | XML | RSS