![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Dec 2004
Posts: 1
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
I suggest learning PHP - if you do it right, you can have it automatically update it as it goes.
|
|
|
|
|
|
#3 |
|
PFO Founder
![]() ![]() |
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. |
|
|
|
|
|
#4 |
|
Programming Guru
![]() ![]() ![]() |
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." |
|
|
|
|
|
#5 |
|
Newbie
Join Date: Mar 2005
Posts: 2
Rep Power: 0
![]() |
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 |
|
|
|
|
|
#6 |
|
Professional Programmer
|
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 |
|
|
|
|
|
#7 |
|
Programming Guru
![]() |
That's insecure.
|
|
|
|
|
|
#8 |
|
Expert Programmer
|
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 checkYou'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. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|