Relative Path
Post any question you may have in regards to GoAnywhere MFT and let our talented support staff and other users assist you.
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
If you need a quicker response, please create a support ticket via the customer portal my.goanywhere.com or contact our support team by email at [email protected].
6 posts
Page 1 of 1
- Posts: 6
- Joined: Fri Dec 02, 2016 3:05 pm
I have a move command that takes in a variable for the source file. I was hoping to set the destination folder to be relative to that file. If there anyway to do that?
Thanks.
Thanks.
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
Do a search on your help for "local file attributes".
Review how to retrieve the "parentFile". This will give you just the path to the file. Then adjust accordingly...
Review how to retrieve the "parentFile". This will give you just the path to the file. Then adjust accordingly...
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
- Posts: 6
- Joined: Fri Dec 02, 2016 3:05 pm
So I found the one example located here:
how-to-use-file-attributes-at-325
I copied that example out. However if I assign to a variable like
<variable name="File" value="resource:smb://SomeDirectory/SomeFile.txt" />
<variable name="FileDirectory" value="${ FileInfo( File):parentFile }" />
The output from ${ FileDirectory} is "${ FileInfo( File):parentFile }" and NOT "resource:smb://SomeDirectory".
Ideas?
how-to-use-file-attributes-at-325
I copied that example out. However if I assign to a variable like
<variable name="File" value="resource:smb://SomeDirectory/SomeFile.txt" />
<variable name="FileDirectory" value="${ FileInfo( File):parentFile }" />
The output from ${ FileDirectory} is "${ FileInfo( File):parentFile }" and NOT "resource:smb://SomeDirectory".
Ideas?
- Posts: 6
- Joined: Fri Dec 02, 2016 3:05 pm
So I found the one example located here:
how-to-use-file-attributes-at-325
I copied that example out. However if I assign to a variable like
<variable name="File" value="resource:smb://SomeDirectory/SomeFile.txt" />
<variable name="FileDirectory" value="${ FileInfo( File):parentFile }" />
The output from ${ FileDirectory} is "${ FileInfo( File):parentFile }" and NOT "resource:smb://SomeDirectory".
Ideas?
how-to-use-file-attributes-at-325
I copied that example out. However if I assign to a variable like
<variable name="File" value="resource:smb://SomeDirectory/SomeFile.txt" />
<variable name="FileDirectory" value="${ FileInfo( File):parentFile }" />
The output from ${ FileDirectory} is "${ FileInfo( File):parentFile }" and NOT "resource:smb://SomeDirectory".
Ideas?
- Posts: 6
- Joined: Fri Dec 02, 2016 3:05 pm
So I found the "Set Variable" task and that worked. Apparently the example in the one post was not quite correct.
- Support Specialist
- Posts: 590
- Joined: Tue Jul 17, 2012 2:12 pm
- Location: Phoenix, AZ
-
The HELP text shows you 2 examples for the FileInfo Function:
Examples
${FileInfo("C:\example.txt"):exists} - Returns true or false indicating whether or not the file exists.
${FileInfo("resource:smb://resourceName/file.txt"):size} - Returns the file size of the specified file in a Network Shares resource.
Keep in mind that the parameter has to be a "STRING" value.
Try this:
<variable name="File" value="resource:smb://SomeDirectory/SomeFile.txt" />
<variable name="FileDirectory" value="${ FileInfo( String( File ) ):parentFile }" />
Examples
${FileInfo("C:\example.txt"):exists} - Returns true or false indicating whether or not the file exists.
${FileInfo("resource:smb://resourceName/file.txt"):size} - Returns the file size of the specified file in a Network Shares resource.
Keep in mind that the parameter has to be a "STRING" value.
Try this:
<variable name="File" value="resource:smb://SomeDirectory/SomeFile.txt" />
<variable name="FileDirectory" value="${ FileInfo( String( File ) ):parentFile }" />
Rick Elliott
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
Lead Solutions Consultant
(402) 944.4242
(800) 949-4696
6 posts
Page 1 of 1