Advise on a Idea I am considering

Post your Gambas programming questions here.
Post Reply
AndyGable
Posts: 359
Joined: Wednesday 2nd December 2020 12:11am
Location: Northampton, England
Contact:

Advise on a Idea I am considering

Post by AndyGable »

Hi Everyone

I am hoping for some advise on a issue I am thinking about.

I am currently working on a offline mode for my software i am doing this by storing all my required updates etc in a file on my local hard drive

sometimes I can have 20-50 of these files on my drive and what I would like to do is have a small program that is running in the background that would pole a given folder location and process the files

the file extensions are as follows

.jor for the journal data (this is everything that happened in the sale
.dat this is what was sold and the qty etc (or anything that was refunded or voided would be in this file)
.ten this is the tender file (example say the sale was £19.98 and they paid £20 change would be £0.02 cash)
.sto this is the stored sale file
.log this is used to record a user action (Sign on, No Sale etc)

so I was wondering how I could make a small Gambas app that would process each file in a row (the files all have the same name example 000001.jor, 000001.dat, 000001.ten, 000001.log

The file name ranges from 000001 to 999999

so the idea would be for it to process all the 000001 files and then delete them and then move onto the 000002 files etc

Can this be done with a Headless application to run on Linux? I would be using a .conf file to control user setup (things like the folder to view database settings and when it should pole a folder (example every 30 seconds)
Online
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Advise on a Idea I am considering

Post by cogier »

This should be simple. Write your program with either Command line application or better still a Graphical application. With the latter, you could Hide your Form perhaps add a TrayIcon with a menu, so you can look at the program's progress at anytime. Set up a Timer in your program to trigger every 30 seconds to carry out whatever it is that it needs to do.

I wrote a program, that runs in the background, it checks to see if a file has been downloaded and then, depending on its extension, moves the file to a different folder. FileTidy. There is a video as well.
Post Reply