Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 20th, 2004, 7:00 AM   #1
Tomos
Newbie
 
Join Date: Dec 2004
Posts: 1
Rep Power: 0 Tomos is on a distinguished road
I am not a programmer and have only experienced dos batch files before. I have constructed a private website for my friends and somebody of that group is going travelling and would like to keep an online diary on my page.
The page runs on a simple unattended server in my garage that automatically accepts uploads through an MSN messenger running on it.

I would like a simple program that checks for the existance of a certain named file 'traveller.txt' for example. Then if it exists, move it into a directory where it can be appended to previous traveller.txt files and then displayed on the website.

So, the traveller uploads her daily diary, it gets moved out of the 'uploads' directory and her previous uploaded text get ammended to it then put into a directory where the website can see it and display it as text on the page.

I don't think thats too hard to write as a batch file that waits 60 seconds before checking and running in a loop..

Can anybody help me with this please?!
Apologies if this isn't in the right sections, but this is a sort of simple script required.
Tomos is offline   Reply With Quote
Old Dec 20th, 2004, 10:05 AM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
I suggest learning PHP - if you do it right, you can have it automatically update it as it goes.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Dec 20th, 2004, 10:25 AM   #3
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,629
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
i think it would be alot easier to find a php blogging script that you can install and would do this but you wouldnt have to upload anything via msn anymore you could just have them log in and post there diary kind of like this forum software even but sorry i cant help with your actually problem as i dont know how i would go about doing it sorry
__________________
BIG K aka Kyle
Programming Forums
Kyle K Online

Please do not PM or email me programming questions. Post them in the forums instead.
big_k105 is offline   Reply With Quote
Old Dec 20th, 2004, 6:19 PM   #4
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
That's fairly easy to do in C++... you can also run it in a scheduled task or a service.

If file exists in X... move file to Y, appending to originial file...

sounds like something i may need eventually, i'll look into it, if i have sufficient time.
__________________
http://jasonpowers.net

"There are a thousand hacking at the branches of evil to one who is striking at the root."
Infinite Recursion is offline   Reply With Quote
Old Mar 31st, 2005, 7:52 PM   #5
david
Newbie
 
Join Date: Mar 2005
Posts: 2
Rep Power: 0 david is on a distinguished road
Unhappy ONE ip one Message submit

Dear I have website it also have a feedback form.
I am using cgiemail form v1.6

The user mostly submit the feedback form more than one time.
Some times a form submitted more that 10 times with the same Ip address.

I want to restrict submit with one IP Address for atleast 24 hours.

My site hosted at linux \ unix based server
I do not know JSP or PHP.


Please help me to solve this problem
email me at davidjohny@yahoo.com
Thankyou in advance
David

Last edited by david; Mar 31st, 2005 at 7:56 PM. Reason: changing colour
david is offline   Reply With Quote
Old Mar 31st, 2005, 8:10 PM   #6
peace_of_mind
Professional Programmer
 
peace_of_mind's Avatar
 
Join Date: Sep 2004
Location: Hell if I know most of the time
Posts: 439
Rep Power: 4 peace_of_mind is on a distinguished road
Send a message via MSN to peace_of_mind Send a message via Yahoo to peace_of_mind
Hey David, double posting is not necessary. And hijacking threads is very annoying. By the way, could you use a larger font, please, I'm having trouble reading that from the next room. Thanks
__________________
Amateurs built the ark
Professionals built the Titanic

peace_of_mind is offline   Reply With Quote
Old Mar 31st, 2005, 11:02 PM   #7
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
That's insecure.
tempest is offline   Reply With Quote
Old Mar 31st, 2005, 11:31 PM   #8
thechristelegacy
Expert Programmer
 
thechristelegacy's Avatar
 
Join Date: Jul 2004
Location: Somerset, Pa
Posts: 707
Rep Power: 5 thechristelegacy is on a distinguished road
Send a message via AIM to thechristelegacy Send a message via MSN to thechristelegacy
Just because I was bored

from time import sleep
from os import chdir

# Keep this script in the same directory as the file you're wanting to copy
# to another location.

PATH_1 = "C:\home" #Change this to were where the first file is
PATH_2 = "C:\Anthonysstuff"  # Change this to whereever you're hosting the files to the internet
FILE_NAME = "traveller.txt" # Name of file


def update(sec):
    while 1:

        chdir(PATH_1)
        first = open(FILE_NAME,"r")
        x = first.read()
        first.close()
        # print len(x)

        chdir(PATH_2)
        second = open(FILE_NAME,"r")
        y = second.read()
        second.close()
        # print len(y)

        

        if len(x) > len(y):
            update = open(FILE_NAME,"w")
            update.write(x)
            update.close()
        else:
           sleep(sec) 

update(60) # The number is parentesies is how many seconds you want it to check

You'll need the Python runtime. Comments pretty much explain it, but if you have any questions, let me know.

Last edited by thechristelegacy; Mar 31st, 2005 at 11:33 PM.
thechristelegacy is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 2:04 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC