 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
feardotcom Guest
|
Posted: Fri Nov 28, 2003 9:08 am Post subject: Filedate |
|
|
This has prob been asked before, but how do I get the filedate and time of a
textfile(any file prob). I want to basically check when a file was last
modified and stop a user from modifying it again within a perion of say
30min.
I have a problem currently where a text report file gets overwritten when a
customer by accident click a button twice.
thx in advance
|
|
| Back to top |
|
 |
Maarten Wiltink Guest
|
Posted: Fri Nov 28, 2003 10:09 am Post subject: Re: Filedate |
|
|
"feardotcom" <feardotnoobz (AT) hayoufellfor (DOT) it> wrote
| Quote: | This has prob been asked before, but how do I get the filedate and
time of a textfile(any file prob).
|
Type "filedate", press F1, choose selected topic, read help.
| Quote: | I want to basically check when a file was last modified and stop a
user from modifying it again within a perion of say 30min. I have
a problem currently where a text report file gets overwritten when
a customer by accident click a button twice.
|
That doesn't sound like the right solution, then. If pressing the
button twice is wrong, prevent it. If it's not, make it work.
Groetjes,
Maarten Wiltink
|
|
| Back to top |
|
 |
J French Guest
|
Posted: Fri Nov 28, 2003 10:22 am Post subject: Re: Filedate |
|
|
On Fri, 28 Nov 2003 11:08:51 +0200, "feardotcom"
<feardotnoobz (AT) hayoufellfor (DOT) it> wrote:
| Quote: | This has prob been asked before, but how do I get the filedate and time of a
textfile(any file prob). I want to basically check when a file was last
modified and stop a user from modifying it again within a perion of say
30min.
I have a problem currently where a text report file gets overwritten when a
customer by accident click a button twice.
|
FileAge
|
|
| Back to top |
|
 |
J French Guest
|
Posted: Fri Nov 28, 2003 10:58 am Post subject: Re: Filedate |
|
|
On Fri, 28 Nov 2003 11:09:48 +0100, "Maarten Wiltink"
<maarten (AT) kittensandcats (DOT) net> wrote:
| Quote: | "feardotcom" <feardotnoobz (AT) hayoufellfor (DOT) it> wrote in message
news:bq739q$e6i$1 (AT) ctb-nnrp2 (DOT) saix.net...
This has prob been asked before, but how do I get the filedate and
time of a textfile(any file prob).
Type "filedate", press F1, choose selected topic, read help.
I want to basically check when a file was last modified and stop a
user from modifying it again within a perion of say 30min. I have
a problem currently where a text report file gets overwritten when
a customer by accident click a button twice.
That doesn't sound like the right solution, then. If pressing the
button twice is wrong, prevent it. If it's not, make it work.
|
<blank line>
I think there might be a bit more to this story than meets the eye
- my double click time is .5 secs
- the idea of a 30 min double click is quite appealing
- I can think of one user for whom it would be appropriate
Something is happening to that 'text file' between creation and max 30
mins - it does not require much imagination to guess the type of
thing.
Checking the date is, of course a bodge
- there should be some sort of 'transmission' mechanism
- with an user/operator override in case of problems
|
|
| Back to top |
|
 |
Tom de Neef Guest
|
Posted: Fri Nov 28, 2003 11:59 am Post subject: Re: Filedate |
|
|
"feardotcom" <feardotnoobz (AT) hayoufellfor (DOT) it> wrote
| Quote: | This has prob been asked before, but how do I get the filedate and time of
a
textfile(any file prob). I want to basically check when a file was last
modified and stop a user from modifying it again within a perion of say
30min.
I have a problem currently where a text report file gets overwritten when
a
customer by accident click a button twice.
thx in advance
|
function FileCreateDate(filename : string) : TdateTime;
// Wat is de OS timestamp van de file ?
var timestamp : integer;
begin
timestamp:=FileAge(filename);
if timestamp>0
then result:=FileDateToDateTime(timestamp)
else result:=0
end;
Tom
|
|
| Back to top |
|
 |
feardotcom Guest
|
Posted: Tue Dec 02, 2003 9:58 am Post subject: Re: Filedate |
|
|
"J French" <erewhon (AT) nowhere (DOT) com> wrote
| Quote: | blank line
I think there might be a bit more to this story than meets the eye
- my double click time is .5 secs
- the idea of a 30 min double click is quite appealing
- I can think of one user for whom it would be appropriate
Something is happening to that 'text file' between creation and max 30
mins - it does not require much imagination to guess the type of
thing.
Checking the date is, of course a bodge
- there should be some sort of 'transmission' mechanism
- with an user/operator override in case of problems
|
The problem I am experiencing is the fact that a wage package I created,
outputs the wage slips to a textfile,
2 wage slips per column and 12 wage slips per page, output to a dos .txt
file was my only option to get TERMINAL/DOS font that would align all the
text nice and neatly and have 2 slips per column.
Once the wage slips have been printed, the data is reset to 0 and all data
posted to a history file, the one client I have, just loves to click the
print wage slips button twice, causing original slips to be overwritten and
only a blank sheet to be displayed, lol.
Argh! I dunno anymore, the only way to stop her(please note) from doing that
is to stop any file from being generated when the filedate is current / less
than (i guessed) 30 min old.
|
|
| Back to top |
|
 |
J French Guest
|
Posted: Tue Dec 02, 2003 10:59 am Post subject: Re: Filedate |
|
|
On Tue, 2 Dec 2003 11:58:32 +0200, "feardotcom"
<feardotnoobz (AT) hayoufellfor (DOT) it> wrote:
| Quote: | "J French" <erewhon (AT) nowhere (DOT) com> wrote in message
news:3fc728c7.66409750 (AT) news (DOT) btclick.com...
blank line
I think there might be a bit more to this story than meets the eye
- my double click time is .5 secs
- the idea of a 30 min double click is quite appealing
- I can think of one user for whom it would be appropriate
Something is happening to that 'text file' between creation and max 30
mins - it does not require much imagination to guess the type of
thing.
Checking the date is, of course a bodge
- there should be some sort of 'transmission' mechanism
- with an user/operator override in case of problems
The problem I am experiencing is the fact that a wage package I created,
outputs the wage slips to a textfile,
2 wage slips per column and 12 wage slips per page, output to a dos .txt
file was my only option to get TERMINAL/DOS font that would align all the
text nice and neatly and have 2 slips per column.
Once the wage slips have been printed, the data is reset to 0 and all data
posted to a history file, the one client I have, just loves to click the
print wage slips button twice, causing original slips to be overwritten and
only a blank sheet to be displayed, lol.
Argh! I dunno anymore, the only way to stop her(please note) from doing that
is to stop any file from being generated when the filedate is current / less
than (i guessed) 30 min old.
|
I am surprized that writing to a Text file was your only method of
getting decent alignment
- have you tried accessing the print Spooler directly using the
OpenPrinter API ?
However there is something to be said for creating text files for
print preview, so maybe there is a bit more to your story than you
said above.
Personally I would regard each print job as a separate batch
- so one prints to :
WG000001.txt
WG000002.txt
etc
That way the main file can never be overwritten, unless you allow it.
I would have thought that it would be pretty easy to detect that a
'wage batch' is empty, and to stop the user in her tracks before
creating any output
- or if that is tricky print to a .TMP file that is only renamed after
your software (and the user) has confirmed that the batch looks Ok
I would be very nervous of something like a 30 min 'pause'
- it is not really addressing the underlying problem
|
|
| Back to top |
|
 |
feardotcom Guest
|
Posted: Wed Dec 03, 2003 7:38 am Post subject: Re: Filedate |
|
|
"J French" <erewhon (AT) nowhere (DOT) com> wrote
| Quote: | On Tue, 2 Dec 2003 11:58:32 +0200, "feardotcom"
lol, |
The customer requested the 30min wait, not I.
I was just thinking of several ways to do it and looking for several ideas,
I do think however that it is a better idea to just generate a new filename
for every payslip print job.
That way, I can prove when she starts lying again: No I didn't, are you sure
cause I did exactly as the manual stated, HA BS.
Thx
|
|
| Back to top |
|
 |
AlanGLLoyd Guest
|
Posted: Wed Dec 03, 2003 9:30 am Post subject: Re: Filedate |
|
|
In article <bqk3pg$1mg$1 (AT) ctb-nnrp2 (DOT) saix.net>, "feardotcom"
<feardotnoobz (AT) hayoufellfor (DOT) it> writes:
| Quote: | The customer requested the 30min wait, not I.
I was just thinking of several ways to do it and looking for several ideas,
I do think however that it is a better idea to just generate a new filename
for every payslip print job.
That way, I can prove when she starts lying again: No I didn't, are you sure
cause I did exactly as the manual stated, HA BS.
|
Wouldn't it be better to store the time one print was called, and if another is
requested with 30 minutes,request confirmation for a remake of the payslips. In
fact if the payments are only every week / month then asked for confirmation if
a reprint is requested within two-thirds of the pay interval.
Of course one would also have a hidden log file of _when_ they were requested
and confirmed - heh-heh-heh.
You could also, if a reprint is requested within 15 minutes, have a mesage
saying ...
"You have consistently stated that you _never_ ask for another payslip with 15
minutes. I think you must have been lying to me, but if you want another
printout now you can have one". Followed by three confirmation notices <g>.
Alan Lloyd
[email]alanglloyd (AT) aol (DOT) com[/email]
|
|
| Back to top |
|
 |
J French Guest
|
Posted: Wed Dec 03, 2003 10:36 am Post subject: Re: Filedate |
|
|
On Wed, 3 Dec 2003 09:38:47 +0200, "feardotcom"
<feardotnoobz (AT) hayoufellfor (DOT) it> wrote:
| Quote: |
"J French" <erewhon (AT) nowhere (DOT) com> wrote in message
news:3fcc6eac.96340968 (AT) news (DOT) btclick.com...
On Tue, 2 Dec 2003 11:58:32 +0200, "feardotcom"
lol,
The customer requested the 30min wait, not I.
I was just thinking of several ways to do it and looking for several ideas,
I do think however that it is a better idea to just generate a new filename
for every payslip print job.
That way, I can prove when she starts lying again: No I didn't, are you sure
cause I did exactly as the manual stated, HA BS.
|
I work on a number of principles
One of which is : 'The Customer is Always Wrong'
Alan G Lloyd's suggestion of a Log File is also a very good idea
- make sure that the Supervisor can view it, but not purge (say) the
last 500 lines (eg: they can purge old stuff, but not all)
- I have found that this provides the users with their own
explanations
- and saves me 'incomprehensible' support queries
Good Luck - you'll have the b*tch pinned down
|
|
| Back to top |
|
 |
Jamie Guest
|
Posted: Wed Dec 03, 2003 11:07 pm Post subject: Re: Filedate |
|
|
just a thought while i am reading this..
in the event that you do not know i will tell you, file dates in a
FAT32 system does not show the changes until the file is closed when a
file date is requested else where.
in a NTFS system when a file date os requested it gets the most
recent (true) file change date regardless if the file has been closed or
not..
so its very possible on a fat32 for another thread/app too poll the
date on a file to see that its older than it really is because the file
is still opened some where.
just thought i would note that..
J French wrote:
| Quote: | On Wed, 3 Dec 2003 09:38:47 +0200, "feardotcom"
[email]feardotnoobz (AT) hayoufellfor (DOT) it[/email]> wrote:
"J French" <erewhon (AT) nowhere (DOT) com> wrote in message
news:3fcc6eac.96340968 (AT) news (DOT) btclick.com...
On Tue, 2 Dec 2003 11:58:32 +0200, "feardotcom"
lol,
The customer requested the 30min wait, not I.
I was just thinking of several ways to do it and looking for several ideas,
I do think however that it is a better idea to just generate a new filename
for every payslip print job.
That way, I can prove when she starts lying again: No I didn't, are you sure
cause I did exactly as the manual stated, HA BS.
I work on a number of principles
One of which is : 'The Customer is Always Wrong'
Alan G Lloyd's suggestion of a Log File is also a very good idea
- make sure that the Supervisor can view it, but not purge (say) the
last 500 lines (eg: they can purge old stuff, but not all)
- I have found that this provides the users with their own
explanations
- and saves me 'incomprehensible' support queries
Good Luck - you'll have the b*tch pinned down
|
|
|
| Back to top |
|
 |
|
|
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 vote in polls in this forum
|
|