Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, howardR), 472 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Hot Folder/Monitor Folder Question? #447692
12/29/14 03:22
12/29/14 03:22
Joined: Oct 2010
Posts: 346
USA
RealSerious3D Offline OP
Senior Member
RealSerious3D  Offline OP
Senior Member

Joined: Oct 2010
Posts: 346
USA
Hello all. I am curious if this is possible in C-Script:

Can a program be written to monitor a folder for new files and then apply an action to the new file?

For example, I want a small program to watch a particular folder and when a JPG is placed in the folder, the program would send it off to a printer to be printed.

There is more to this, but this is a start. Can it be done?

Easy on me, please, I am an artist and know very little about C-Script.

Re: Hot Folder/Monitor Folder Question? [Re: RealSerious3D] #447737
12/31/14 23:25
12/31/14 23:25
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
I'll be debby downer for a bit... C-Script, or Gamestudio in general, really, is the wrong tool for this job. You don't want an engine initialized just for what is essentially a daemon process that just watches a folder.

Now... Can you watch a folder? Most certainly yes! Either way it'll boil down to real C/C++, wether with gamestudio or in a more appropriate environment. The only difference is that gamestudio would need a DLL whereas you could just write a program in C/C++ that does this and you lose a lot of the overhead you would otherwise have. Here is the appropriate MSDN documentation for what you want to do.

Printing... Well, printing is a lot of pain. Printers are a lot of pain. You can get something very simple with ShellExecute, but ideally you'd have to dig down into the printer spooler API, which is going to be a lot of not so much fun hours.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: Hot Folder/Monitor Folder Question? [Re: WretchedSid] #447739
01/01/15 09:38
01/01/15 09:38
Joined: Oct 2010
Posts: 346
USA
RealSerious3D Offline OP
Senior Member
RealSerious3D  Offline OP
Senior Member

Joined: Oct 2010
Posts: 346
USA
Yep, I absolutely know it's the wrong tool for the job. No doubt about it. It's a game engine, after all. Even so, I was curious for my own reasons. laugh

Ah, then if GameStudio needs a DLL to do this (i.e it could not be programmed in C-Script alone), then that answers my question. The answer is NO. laugh

Printing is not really an issue for what I was thinking about. As long as the printers are using their proper color profiles, are tweaked for what I want done, and are already set to default for the size of print, etc., then at this point it is simply sending the image to the printer.

Thanks for your response, though, WretchedSid. I do appreciate it.


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1