Subj : Moving files between Filebases
To   : Digital Man
From : Nightfox
Date : 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)


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

DM> This was an oversight on my part. I can fix that for a future release, but
DM> 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