• Moving files between Filebases

    From Nightfox@VERT/DIGDIST to Digital Man on Tuesday, February 01, 2022 14:06:34
    Hi DM,

    If one wanted to move a file from one Filebase to another, I don't see a specific function in the JS object model documentation for doing so. Would this be the correct way?

    1. Get the file's metadata object using FileBase.get(filename, FileBase.DETAIL.EXTENDED)

    2. Remove the file from the FileBase using FileBase.remove(filename, false)

    3. Move the file to the other filebase directory, open that filebase, and use FileBase.Add(meta-data object)


    I'm wondering if this will preserve stats such as the total number of downloads for the file, etc.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Tuesday, February 01, 2022 17:11:44
    Re: Moving files between Filebases
    By: Nightfox to Digital Man on Tue Feb 01 2022 02:06 pm

    Hi DM,

    If one wanted to move a file from one Filebase to another, I don't see a specific function in the JS object model documentation for doing so. Would this be the correct way?

    1. Get the file's metadata object using FileBase.get(filename, FileBase.DETAIL.EXTENDED)

    2. Remove the file from the FileBase using FileBase.remove(filename, false)

    3. Move the file to the other filebase directory, open that filebase, and use FileBase.Add(meta-data object)


    I'm wondering if this will preserve stats such as the total number of downloads for the file, etc.

    I think that would work, but it would *not* retain the last_downloaded/times_downloaded (and some other stats) property values of the file. :-(

    This was an oversight on my part. I can fix that for a future release, but it's too late for v3.19b.
    --
    digital man (rob)

    Synchronet "Real Fact" #41:
    Synchronet's cross-platform library is called XPDEV (named before Windows XP) Norco, CA WX: 57.5øF, 68.0% humidity, 5 mph SSW wind, 0.00 inches rain/24hrs ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Tuesday, February 01, 2022 18:17:58
    Re: Moving files between Filebases
    By: Digital Man to Nightfox on Tue Feb 01 2022 05:11 pm

    If one wanted to move a file from one Filebase to another, I don't see
    a specific function in the JS object model documentation for doing so.
    Would this be the correct way?

    1. Get the file's metadata object using FileBase.get(filename,
    FileBase.DETAIL.EXTENDED)

    2. Remove the file from the FileBase using FileBase.remove(filename,
    false)

    3. Move the file to the other filebase directory, open that filebase,
    and use FileBase.Add(meta-data object)


    I think that would work, but it would *not* retain the last_downloaded/times_downloaded (and some other stats) property values of the file. :-(

    This was an oversight on my part. I can fix that for a future release, but it's too late for v3.19b.

    I think that would be useful to have. As I've been working on my file lister, I've implemented a sysop action to move a file from one FileBase to another and have implemented it as above for now.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com
  • From Digital Man@VERT to Nightfox on Tuesday, February 01, 2022 19:15:36
    Re: Moving files between Filebases
    By: Nightfox to Digital Man on Tue Feb 01 2022 06:17 pm

    Re: Moving files between Filebases
    By: Digital Man to Nightfox on Tue Feb 01 2022 05:11 pm

    If one wanted to move a file from one Filebase to another, I don't see
    a specific function in the JS object model documentation for doing so.
    Would this be the correct way?

    1. Get the file's metadata object using FileBase.get(filename,
    FileBase.DETAIL.EXTENDED)

    2. Remove the file from the FileBase using FileBase.remove(filename,
    false)

    3. Move the file to the other filebase directory, open that filebase,
    and use FileBase.Add(meta-data object)


    I think that would work, but it would *not* retain the last_downloaded/times_downloaded (and some other stats) property values of the file. :-(

    This was an oversight on my part. I can fix that for a future release, but it's too late for v3.19b.

    I think that would be useful to have. As I've been working on my file lister, I've implemented a sysop action to move a file from one FileBase to another and have implemented it as above for now.

    Does that action work as expected (save for those 3 'stats' properties)?
    --
    digital man (rob)

    Synchronet "Real Fact" #2:
    Synchronet version 2 for DOS and OS/2 was released to the public domain in 1997 Norco, CA WX: 53.5øF, 81.0% humidity, 0 mph E wind, 0.00 inches rain/24hrs
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Nightfox@VERT/DIGDIST to Digital Man on Tuesday, February 01, 2022 19:19:08
    Re: Moving files between Filebases
    By: Digital Man to Nightfox on Tue Feb 01 2022 07:15 pm

    1. Get the file's metadata object using FileBase.get(filename,
    FileBase.DETAIL.EXTENDED)

    2. Remove the file from the FileBase using
    FileBase.remove(filename, false)

    3. Move the file to the other filebase directory, open that
    filebase, and use FileBase.Add(meta-data object)

    I think that would be useful to have. As I've been working on my file
    lister, I've implemented a sysop action to move a file from one
    FileBase to another and have implemented it as above for now.

    Does that action work as expected (save for those 3 'stats' properties)?

    Yes, it does appear to work as expected.

    Nightfox

    ---
    þ Synchronet þ Digital Distortion: digitaldistortionbbs.com