Go Back   FlashFXP Forums > >

FlashFXP v5.x Public Beta Please direct all comments, suggestions, bug reports, and feedback for public beta releases to this forum.

Closed Thread
 
Thread Tools Rate Thread Display Modes
Old 06-10-2015, 08:50 AM   #1
bigstar
FlashFXP Developer
FlashFXP Administrator
ioFTPD Beta Tester
 
bigstar's Avatar
 
Join Date: Oct 2001
Posts: 8,012
Default

Sorry, I misunderstood exactly what you were trying to do.

The reason a checkbox on the move dialog wont work is because the command that needs to be performed is specific to the FTP server brand, in this case ioFTPD.

The revised code will move the folder from the current location to @dst@ and then create a symlink in the current folder pointing to the new location.

I also quoted the paths, this is needed for the /move macro, but I am unsure if site chattr command can handle them, if not you may need to remove them, but otherwise they would be needed if the folder name contains any spaces.

Code:
#This script is command specific to ioFTPD servers
#only allow this command to run if the remote browser is active
/require remote
# prompt the user to select the target folder
/set @dst@ $selectfolder("Move Folder and create SymLink", "Select Folder:")
#For-each item selected
{
    /move "%f" "@dst@%f"
    site chattr +l "%f" "@dst@%f"
}
/list
bigstar is offline  
Old 06-10-2015, 11:58 AM   #2
brackebuschtino
Member
FlashFXP Registered User
 
Join Date: Feb 2012
Location: /dev/null
Posts: 40
Default

Quote:
The reason a checkbox on the move dialog wont work is because the command that needs to be performed is specific to the FTP server brand, in this case ioFTPD.
I see.

Quote:
The revised code will move the folder from the current location to @dst@ and then create a symlink in the current folder pointing to the new location.
The code still has a bug. From the output log i read that the directory to apply the "CHATTR" command to does not exist. Here's the log:

Code:
[L] [CMD] /require remote
[L] [CMD] /set @dst@ $selectfolder("Move Folder and create SymLink", "Select Folder:")
[L] [CMD] /move "Test_Directory" "/ARCHiVE/Test_Directory"
[L] RNFR Test_Directory
[L] 350 Directory exists, ready for destination name.
[L] RNTO /ARCHiVE/Test_Directory
[L] 250 RNTO command successful.
[L] site chattr +l "Test_Directory" "/ARCHiVE/Test_Directory"
[L] 500 "Test_Directory: No such file or directory.
[L] [CMD] /list
So i added another line to fix that:
Code:
#For-each item selected
{
    /move "%f"  "@dst@%f"
    MKD "%f"
    site chattr +l "%f" "@dst@%f"
}
This finally does what i want. But i still have some individual requirements for the symlink naming. I'd like to strip some part(s) out of the target path name before it is created and use it to prepend it to the symlink name like for instance:

Quote:
name of directory to move: [Cat.No.] Test_Directory // strip and dump the substring "[Cat.No.]"
name of target directory: /ARCHiVE/Test_Directory
name of symlink: [Cat.No.] Test_Directory // prepend the dumped substring "[Cat.No.]"
I noticed you mentioned "macros".

Would you mind hinting me to a documentation for how to write FFXP macros?
Also, would you mind telling me what language is used for the RAW commands? Is there are a documentation explaining string operations?
Also, would you mind telling me how to convert that script into an ioFTPD custom command or make it executable via shortscuts to prevent me from copy+paste that script around all the time?

Last edited by brackebuschtino; 06-10-2015 at 12:25 PM.
brackebuschtino is offline  
Closed Thread

Tags
move, target, feature, toggle, demand, e.g, create, symlink, ffxp, popup

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 03:50 AM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)