In Sage X3, we may come across a situation where we need to know whether the path or a particular directory exists or not.
We can know this using following function:
Syntax: filinfo(path_fil, arg_ent)
Parameters:
path_fil: Char type expression for the file path to be tested
Arg_ent: Integer expression specifying the property to be found. It can be from 0 to 10.
Kindly refer to the below snippet of code for better understanding.
Here, we have used “7” as arg_ent (parameter) of filinfo function which gives size of file in octets.
If the file size found is negative, the file does not exist.
Here, the path defined in variable PATH is valid. Hence the output will be as follows:
Hope this helps!
About Us
Greytrix is one stop solution provider for Sage ERP and Sage CRM needs. We provide complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third party add-on development and implementation expertise.
Greytrix have some unique solutions of Sage X3’s integration with Sage CRM, Salesforce.com and Magento eCommerce. It also offers best-in-class Sage X3 customization and development services to Sage business partners, end users, and Sage PSG worldwide.
For more information on Sage X3 Integration and Services, please contact us at x3@greytrix.com .We will be glad to assist you.
Other related Blogs:
How to access only files from directory
http://www.greytrix.com/blogs/sagex3/2015/11/27/how-to-access-only-files-from-directory/
Deleting a file from a directory
http://www.greytrix.com/blogs/sagex3/2015/06/30/deleting-a-file-from-a-directory-2/
Delete Folder in Sage X3
http://www.greytrix.com/blogs/sagex3/2013/01/23/delete-folder-in-sage-x3/
Creating a directory pro-grammatically in X3
http://www.greytrix.com/blogs/sagex3/2014/02/28/creating-a-directory-programmatically-in-x3/
List the files from the directory
http://www.greytrix.com/blogs/sagex3/2013/12/23/list-the-files-from-the-directory/