Thursday, August 22, 2019

Tip of the Day: Using the New FSTATUS Function
Product.......: R:BASE X.5 and R:BASE X.5 Enterprise (Version 10.5)
Build.........: 10.5.1.30822 or higher
Sections......: Functions
Keywords......: File, Folder, Hidden, Read Only, Open

Did you know you can check to see if a file exists, and also the file status?

The new FSTATUS function has been implemented to check if a file or folder
exists, and also returns the status for the file. The read only, opened,
available, and hidden file status can be retrieved.

If no path is specified, the function checks for the file or folder name in
the current directory. Otherwise, the function checks for the file or folder
name in the specified location. The function returns following possible values:

0 = file/folder does not exist
1 = file/folder exists, but cannot be read or written to. Folders will
    return this value, as well as file name searches with wild cards.
2 = file is marked as a read only file
3 = file is not marked as read only, but can only read it at this time
    (the file is opened by another program)
4 = file can be read and written to
If the file is marked as hidden, the return value will be incremented by 10;
    12 = read only and hidden, 14 = can read and write and hidden

Example (The brates.xlsx file exists, is marked hidden, and is opened):

SET VAR vFileStatus INTEGER = (FSTATUS('brates.xlsx'))
SHOW VAR vFileStatus
13

In many applications, the ability to know if a file is open is quite important.
For example, when using the GATEWAY command and verifying a spreadsheet is not
already open is very beneficial.

Very Best R:egards,

Razzak.

https://www.rbase.com
http://www.facebook.com/rbase/


--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/201908221304.x7MD4q5t119367%40atl4mhob23.registeredsite.com.

Reply via email to