Section 11: TSP command reference Model 2601B-PULSE System SourceMeter Instrument Reference Manual
11-94 2601B-PULSE-901-01A April 2020
Example 1
print("Is directory: ", fs.is_dir("/usb1/"))
Because /usb1/ is always the root directory of an inserted flash drive, you can use this command to verify that
USB flash drive is inserted.
Example 2
if fs.is_dir("/usb1/temp") == false then
fs.mkdir("/usb1/temp")
end
Insert a USB flash drive into the front panel of the instrument.
Check to see if the temp directory exists.
If it does not exist, create a directory named temp.
Also see
fs.is_file() (on page 11-94)
fs.is_file()
Tests whether the specified path refers to a file (as opposed to a directory).
Usage
status = fs.is_file("path")
true if the given path is a file; otherwise, false
The path of the file system entry to test
Details
The file system path may be absolute or relative to the current working system path.
Example
rootDirectory = "/usb1/"
print("Is file: ", fs.is_file(rootDirectory))
Insert a USB flash drive into the front panel of the instrument.
Set rootDirectory to be the USB port.
Check to see if rootDirectory is a file. Because rootDirectory was set up as a directory, the return is
false.
Also see
fs.is_dir() (on page 11-93)