Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 11:13 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Directory Listing
PostPosted: December 15th, 2005, 6:46 pm 
Offline

Joined: November 3rd, 2004, 6:44 pm
Posts: 59
Location: Ipswich, UK
Is it possible to find and list the contents of a directory?

I would like to be able to find a list of the files in a specific directory which hold the question and answers for some simple tests my pupils have written. I want to be able to read these filenames into a list box so that they can select the question set that they want to answer. All of this needs to be dynamic so that as they add others test files they will be available for them to select when they start the program again.

I think I might be able to do it with a DOS batch file that writes the DIR contents to a text file but I wonder if there is a neater way?

Thanks

Clive Cartmel


For this message Clive Cartmel has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: December 15th, 2005, 9:09 pm 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
There is no directory listing tool in Opus. There are two options I can see:

1. Dos batch write to file.

2. Use the File Browse action to look in a specific folder for a specific file extension and the end user then selects the file they want to load.


Regards


Brenden Knifton


For this message Brenden Knifton has been thanked by : mackavi


Top
 Profile Visit website  
 
 Post subject:
PostPosted: May 21st, 2008, 1:34 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
An old question... one I have some curiosity with also -- how to accomplish.

It is not a 'burning issue' for me right now, but I did come across this:
http://www.paris-pc-gis.com/mb_r/dll/dl ... _start.htm
That site outlines DLL arguments and return values for certain Windows libraries. May be somewhat 'old', but still valid?

Opus' CallFn( zzzzzz ) seems to be making more sense, given some other recent posts.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 21st, 2008, 9:33 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Lar,

You must be thinking on the same track as me at the moment - although I'm trying to avoid the confusion that you mention in the other post :-)

I've looked at Dos, windows libraries and a few other solutions but these were either extremely time consuming to unpick or didn't offer the professional level of integration I was after.

I wanted this functionality for several projects, so I spoke to contact who has already written several DLLs for projects Interaktiv have developed and the cost was reasonable. I'm hoping to have the DLL sometime in the next couple of weeks.

The basic purpose of this function for me is to eliminate the need for file browsing in various educational games but instead have Opus read all files in a specific folder into a user friendly custom lookup box.

As this is a generic DLL, already planned for use in several publications, I don't see why we can't offer it to others for a small charge - as I imagine that it could provide extremely useful for many other projects and would save the time and hassle of alternative solutions.

If anybody is interested in this DLL, drop us an email at sales(at)interaktiv.co.uk

Regards,

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: May 21st, 2008, 9:51 pm 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
I posted a windows utility on John Ekkers old Opus forum in 2004 that writes a directory listing to a text file, using parameters supplied at runtime. It was compiled for use with Opus and it runs silently.
By design this version ignores subdirectories and lists only the filenames in the required folder.
Since the old forum appears to be down I'll post it again here.

Usage::
Run the exe without parameters and you will see how to use it.

Paul


For this message Paul has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 21st, 2008, 10:43 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Cheers Paul,

This was the type of thing I was looking for :-) I had found some C# code and compiled it as a windowless project to achieve a similar effect - but I couldn't reach the author to see if I could use it in a commercial capacity.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: May 22nd, 2008, 5:42 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Thanks, Paul

I think I had seen someone else pluck your Utility program from out of the archives, but I did not take it seriously. What I mean is I did not make the association that it could be shipped with an Opus pub and run/launched from the Opus pub.

So you and Mack have cleared that up here.

I tested it in a simple pub... sure enough it works (as one should expect).

Some 'test' observations:
-- the parameter gets placed in the Launch File action dialog without quotes or parm delimiters ( i.e., no " " marks, no < > marks )
-- example: g:\temp1 *.* G:\temp2\PaulsDirOutput
-- the utility program does not like (will not accept) Destination file name with any spaces. e.g., Pauls Dir Output.txt will just write to a file... pauls
-- program lists everything in lowercase
-- it is possible to 'not see' the output filename from within Opus (when I wanted to use a ReadFile action, the dialog to 'Browse' and find that file did not 'show' the file... and there is no 'file association' defined... but typing the name in works anyway)

I say Paul's... as you have surfaced it. Apparently 'author' goes back further... thanks to all.

For my purposes this works... for now.
I will want to pump that list into a database table. (during Pub development process)
I do want to have Upper/Lower case retained... but it is not a show-stopper.
Not sure about approach I'll use with Users of the pub.

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 22nd, 2008, 8:46 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Thanks Lar,

The path name is the old dos issue and seems to apply to both the scan & output directories. IE:

Program Files becomes progra~1. An Opus Script could convert to the 8.3 format but I'm not sure how you'd handle similar named folders. IE:

Program Toys would become progra~2 which I'm not sure could be identified in the Opus Script - it would simply think that it was still 1!

The extension bit should be fine - but you do have to specify it in the CMD. IE:

output.txt rather than output

I haven't tested this in Opus but it would be odd if the browse file couldn't see it.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: May 22nd, 2008, 9:11 am 
Offline

Joined: November 11th, 2004, 4:05 am
Posts: 636
Location: Christchurch, NZ
I should have explained more fully -- I wrote this application myself as a win32 application, to avoid 8.3 dos limitations.

Wrap any parameter containing spaces with quotes, and if you want a filename written with spaces, enclose them in quotes as well.

You can rename the exe to whatever you want, I usually shorten it's name to dl.exe.

c:\dl.exe "c:\program files" *.* "c:\spaces here.txt"

will write a text file called "spaces here.txt" containing a list of all loose files in the Program Files directory.

Paul


For this message Paul has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 22nd, 2008, 10:46 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Thx Paul.

Quote:
I wrote this application myself as a win32 application
thanks for building and sharing.

Works fine.
At this point I'm just starting down this vein, so don't know whether DOS type name truncation will be an issue or not.
Quote:
Program Toys would become progra~2
I have not seen that yet. The listed filenames themselves are "intact", just not 'pretty' with CaseCaps.

Thanks for the additional explanations.

L

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 22nd, 2008, 11:17 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
you've misunderstood :-)

I was suggesting that by entering the paths as 8.3 that you could solve the directory names with spaces - but as Paul as since added - you can use quotes to wrap.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: May 28th, 2008, 10:24 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Lar,

As promised, an example of the DLL that Interaktiv have had written for use in our games.

Same principle as the DOS program - except that it reads the file at a given index and returns it straight to Opus.

http://www.interaktiv.co.uk/index.php?o ... Itemid=151

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: May 29th, 2008, 7:34 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Thx, Mack

I do not have my system set up to eval this right now*, but it sounds interesting as an enabler. Might just fit what I'm trying to do... drive Page content sequences from User selections and a look-up table, the effect much like a MF would accomplish but with content elsewhere/in files.
*( I've put off getting VPC set up until I figure out the Microsoft licensing re: OEM windows OS)

Curious:
Quote:
except that it reads the file at a given index and returns it straight to Opus.
Could you explain 'index' here? If I set up a pub to load a certain file to a specific textobject, then later add more files to that directory... would that throw-off the 'index'?

_________________
_good things come to those who wait(0)_


For this message Lar_123 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: May 29th, 2008, 7:57 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Lar,

The evaluation dialogue is merely a caveat. It's actually a zip file containing a standalone publication and DLL in the same folder - so there is little reason that it would affect a system as nothing is installed and the publication makes no system changes.

The index is simply a way of telling the DLL with file to read in - it doesn't relate a specific file - as you'll retrieve the file name and work from that. The primary reason for the DLL is to added to our game publications (such as Hide-n-Seek) and read all the different dictionary files from the given directory into the custom list box we wrote a couple of months back - thus allowing the player to simply select which word bank they want to use.

Of course, files maybe added / delete from this directory and the index values will thus change, but the publication / player doesn't need these as the name of the file is read into memory and displayed on screen.

This doesn't mean to say, that you couldn't track file name against index and thus track whether changes to the folder have occurred.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Dir Listing
PostPosted: May 29th, 2008, 6:54 pm 
Offline

Joined: March 8th, 2005, 9:40 pm
Posts: 63
Hi Clive,

See viewtopic.php?t=2845&highlight=dir

I needed to list the files in a directory and then delete them. I am sure that you could modify it quite easily to suit your needs.

Regards

Neil

_________________
Opus Pro V6
Dell Inspiron 9400
Intel Centrino Duo 2GHz
2 Gig Ram
XP SP2


For this message Nitro has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 16 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
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group