• FGET_TIME

    From Ace@DSTREAM to ALL on Friday, February 15, 2002 03:54:00
    I'm trying to put a files time-date stamp into a str to compare later
    on. Instead of getting, for example a file created today, todays
    date-time on the file, I'm getting Thu Jan 01 1970 12:00 am ???


    str newsdate
    int newsfile time


    FOPEN newsfile O_RDONLY "e:\sbbs\xtrn\news.txt"
    FGET_TIME newsfile time
    TIME_STR newsdate time
    FCLOSE newsfile

    ---
    ■ QMPro 1.53 ■ telnet://dsbbs.net - http://www.dsbbs.net
    ■ Synchronet ■ Data Stream - telnet://dsbbs.net - www.dsbbs.net
  • From Digital Man to Ace on Friday, February 15, 2002 04:28:43
    Re: FGET_TIME
    By: Ace to ALL on Fri Feb 15 2002 11:54 am

    I'm trying to put a files time-date stamp into a str to compare later
    on. Instead of getting, for example a file created today, todays
    date-time on the file, I'm getting Thu Jan 01 1970 12:00 am ???


    str newsdate
    int newsfile time


    FOPEN newsfile O_RDONLY "e:\sbbs\xtrn\news.txt"
    FGET_TIME newsfile time
    TIME_STR newsdate time
    FCLOSE newsfile

    FGET_TIME is not implemented in Synchronet v3 (I don't remember the reason). Use the GET_FILE_TIME function instead, which is much simplier and doesn't require opening and closing the file.

    -Rob
  • From Winston Smith@ANETBBS to Ace on Friday, February 15, 2002 06:39:00
    RE: FGET_TIME
    BY: Ace to ALL on Fri Feb 15 2002 11:54 am

    I'm trying to put a files time-date stamp into a str to compare later
    on. Instead of getting, for example a file created today, todays
    date-time on the file, I'm getting Thu Jan 01 1970 12:00 am ???

    Yes. That is a UNIX C compiler Epoch Time Zero event. It means that you have an empty or zero value for the number of ticks in your clock value. On an IBM PC a Time of "zero" would give you a date of Tuesday, Jan 01 1980 12:00 am (i.e. hours, mins, secs, are all zero.) 'C' compiler time and UNIX time starts on January 1st, 1970. IBM PC MS-DOS time starts on January 1st, 1980. What it means is that your code is pointing to an "empty space", rather than to something that has clock ticks in it.

    ---
    ■ Synchronet ■ AnotherNet BBS ■ S. Burlington, VT ■ telnet://bbs.another.org
  • From Ace@DSTREAM to DIGITAL MAN on Friday, February 15, 2002 12:54:00
    I'm trying to put a files time-date stamp into a str to compare
    later
    > > on. Instead of getting, for example a file created today, todays
    > > date-time on the file, I'm getting Thu Jan 01 1970 12:00 am ???
    > >
    > >
    > > str newsdate
    > > int newsfile time
    > >
    > >
    > > FOPEN newsfile O_RDONLY "e:\sbbs\xtrn\news.txt"
    > > FGET_TIME newsfile time
    > > TIME_STR newsdate time
    > > FCLOSE newsfile

    FGET_TIME is not implemented in Synchronet v3 (I don't remember the reason).
    >Use the GET_FILE_TIME function instead, which is much simplier and doesn't
    >require opening and closing the file.

    I can't get this...! (DAMN!) The above makes sense to me but
    GET_FILE_TIME <int_var> <str_var> doesn't, and seems opposite of what I
    need. How do I get "e:\sbbs\xtrn\news.txt" into <str_var> to use in
    this function, and then that date/time into my newsdate string?

    ---
    ■ QMPro 1.53 ■ telnet://dsbbs.net - http://www.dsbbs.net
    ■ Synchronet ■ Data Stream - telnet://dsbbs.net - www.dsbbs.net
  • From Digital Man to Ace on Friday, February 15, 2002 15:31:22
    Re: FGET_TIME
    By: Ace to DIGITAL MAN on Fri Feb 15 2002 08:54 pm

    > > str newsdate
    > > int newsfile time
    > >
    > >
    > > FOPEN newsfile O_RDONLY "e:\sbbs\xtrn\news.txt"
    > > FGET_TIME newsfile time
    > > TIME_STR newsdate time
    > > FCLOSE newsfile

    FGET_TIME is not implemented in Synchronet v3 (I don't remember the reaso
    >Use the GET_FILE_TIME function instead, which is much simplier and doesn'
    >require opening and closing the file.

    I can't get this...! (DAMN!) The above makes sense to me but
    GET_FILE_TIME <int_var> <str_var> doesn't, and seems opposite of what I need. How do I get "e:\sbbs\xtrn\news.txt" into <str_var> to use in
    this function, and then that date/time into my newsdate string?

    str fname
    int ftime
    str newsdate
    set fname "e:/sbbs/xtrn/news.txt"
    get_file_time ftime fname
    time_str newsdate ftime


    That should work. What did you try?

    -Rob
  • From Amcleod to Digital Man on Friday, February 15, 2002 21:11:44
    Re: FGET_TIME
    By: Digital Man to Ace on Fri Feb 15 2002 11:31 pm

    That should work. What did you try?
    ^^^^^^^^^^^^^^^^^
    Hahaha! Very funny!
  • From Ace@DSTREAM to DIGITAL MAN on Saturday, February 16, 2002 04:49:00
    > > I can't get this...! (DAMN!) The above makes sense to me but
    > > GET_FILE_TIME <int_var> <str_var> doesn't, and seems opposite of what I
    > > need. How do I get "e:\sbbs\xtrn\news.txt" into <str_var> to use in
    > > this function, and then that date/time into my newsdate string?

    str fname
    >int ftime
    >str newsdate
    >set fname "e:/sbbs/xtrn/news.txt"
    >get_file_time ftime fname
    >time_str newsdate ftime


    That should work. What did you try?

    Holy crap! What genius decided to use /'s instead of normal \'s ?? No
    wonder I've had such a hard time...! Why is this and how long has it
    been a secret? (prg works great now btw, thanks! :)

    (PS. I was also using SETSTR instead of SET)

    ---
    ■ QMPro 1.53 ■ telnet://dsbbs.net - http://www.dsbbs.net
    ■ Synchronet ■ Data Stream - telnet://dsbbs.net - www.dsbbs.net
  • From Amcleod to Ace on Saturday, February 16, 2002 08:48:07
    Re: FGET_TIME
    By: Ace to DIGITAL MAN on Sat Feb 16 2002 12:49 pm

    Holy crap! What genius decided to use /'s instead of normal \'s ??

    Uh, it's "\" that is AB-normal. ANyway, _either_ works, but of course, the "\" is the ESCape character in C-ish strings, so you have the choice:

    Remain a Thrall to the evil of Mordor ^W Microsoft and use

    "e:\\sbbs\\xtrn\\news.txt"

    (escaping the backslashes with another backslash), OR:

    Join the civilized world and use

    "e:/sbbs/xtrn/news.txt"

    or as civilized as possible, seeing as you have to stick with that abomination known as a "Drive Letter".
  • From Digital Man to Ace on Saturday, February 16, 2002 18:09:15
    Re: FGET_TIME
    By: Ace to DIGITAL MAN on Sat Feb 16 2002 12:49 pm

    > > I can't get this...! (DAMN!) The above makes sense to me but
    > > GET_FILE_TIME <int_var> <str_var> doesn't, and seems opposite of what
    > > need. How do I get "e:\sbbs\xtrn\news.txt" into <str_var> to use in
    > > this function, and then that date/time into my newsdate string?

    str fname
    >int ftime
    >str newsdate
    >set fname "e:/sbbs/xtrn/news.txt"
    >get_file_time ftime fname
    >time_str newsdate ftime


    That should work. What did you try?

    Holy crap! What genius decided to use /'s instead of normal \'s ??

    Either one will work, but forward-slashes are Unix-compatible and back-slashes are not.

    No wonder I've had such a hard time...!

    Back-slashes were not your problem.

    Why is this and how long has it been a secret?

    It hasn't been a secret. I've posted about forward slashes in Baja pathnames many times.

    (prg works great now btw, thanks! :)

    Great!

    (PS. I was also using SETSTR instead of SET)

    Doesn't matter, either will work (to set the "str" variable, that is).

    -Rob
  • From Winston Smith@ANETBBS to Ace on Saturday, February 16, 2002 12:15:00
    RE: FGET_TIME
    BY: Ace to DIGITAL MAN on Sat Feb 16 2002 12:49 pm

    Holy crap! What genius decided to use /'s instead of normal \'s ?? No wonder I've had such a hard time...! Why is this and how long has it
    been a secret? (prg works great now btw, thanks! :)

    That is the UNIX C compiler again. UNIX uses a forward slash, and since C is used to build UNIX, many 'C' compilers use a forward slash. If you are using an editor written in 'C' like EMacs, you have to use forward slashes in the file descriptors. It gets somewhat confusing forward slashing the filenames and backslashing the shell command moves, but you get used to it!


    ... WWW.WERS.ORG, WERS Streaming Audio, 22:00 UTC/GMT, "The Playground"
    ... WWW.WERS.ORG, Saturdays, Sundays, 22:00-00:99 UTC/GMT, Playground

    ---
    ■ Synchronet ■ AnotherNet BBS ■ S. Burlington, VT ■ telnet://bbs.another.org
  • From bgdsr@VBARNET to Ace on Saturday, February 16, 2002 06:33:00
    RE: FGET_TIME
    BY: Ace to DIGITAL MAN on Sat Feb 16 2002 12:49 pm

    > > I can't get this...! (DAMN!) The above makes sense to me but
    > > GET_FILE_TIME <int_var> <str_var> doesn't, and seems opposite of what
    > > need. How do I get "e:\sbbs\xtrn\news.txt" into <str_var> to use in
    > > this function, and then that date/time into my newsdate string?

    str fname
    >int ftime
    >str newsdate
    >set fname "e:/sbbs/xtrn/news.txt"
    >get_file_time ftime fname
    >time_str newsdate ftime


    That should work. What did you try?

    Holy crap! What genius decided to use /'s instead of normal \'s ?? No wonder I've had such a hard time...! Why is this and how long has it
    been a secret? (prg works great now btw, thanks! :)

    (PS. I was also using SETSTR instead of SET)


    Have you ever heard off UNIX? as for the / verses \
    lol

    --Barry

    ---
    ■ Synchronet ■ VBARNET BBS * Baltimore, MD USA * telnet://vbarnet.d2g.com
  • From Digital Man to Winston Smith on Sunday, February 17, 2002 12:04:01
    Re: FGET_TIME
    By: Winston Smith to Ace on Sat Feb 16 2002 08:15 pm

    RE: FGET_TIME
    BY: Ace to DIGITAL MAN on Sat Feb 16 2002 12:49 pm

    Holy crap! What genius decided to use /'s instead of normal \'s ?? No wonder I've had such a hard time...! Why is this and how long has it been a secret? (prg works great now btw, thanks! :)

    That is the UNIX C compiler again. UNIX uses a forward slash, and since C i used to build UNIX, many 'C' compilers use a forward slash.

    No, this has nothing to do with 'C' compilers or the 'C' programming language.

    If you are usin
    an editor written in 'C' like EMacs, you have to use forward slashes in the file descriptors. It gets somewhat confusing forward slashing the filenames and backslashing the shell command moves, but you get used to it!

    DOS-based OSes support forward slashes in the pathnames access from programs, but not from the command shell (where they require backslashes).

    -Rob