# (close file-descriptor) [GstarCAD 2012](../../../Index.md) → [Developer Reference](../../%28Developer%20Reference%29.md) → [AutoLISP Reference](../%28AutoLISP%20Reference%29.md) → [LISP Functions](%28LISP%20Functions%29.md) <a id="143"></a> ## (close file-descriptor) --- Close an open file. --- This function closes access to a file that has been previously opened with the [open](%28open%20filename%20mode%29.md) function. Strictly speaking, it is not necessary to close files, since GstarCAD® does that when it exits. However, for good housekeeping, it's a good idea to use the **close** function. The *file-descriptor* argument represents the file descriptor assigned when the file was opened using the **open** function. The file descriptor remains after the file is closed but is not valid. **Example** | Code | Returns | | --- | --- | | (**close** fil) | nil | **NOTE** The *file-descriptor* must be assigned to a symbol using [setq](%28setq%20symbol1%20statement1%20-symbol2%20statement2-%20...%29.md)**,** so the symbol must be used with the **close** function as the *file-descriptor.* **Tell me about...** [(print \[expression \[file-descriptor\]\])](%28print%20-expression%20-file-descriptor-%29.md) [LISP Compatibility](../LISP%20Compatibility.md) [Programming Overview of LISP (LISt Processing) Language](../Programming%20Overview%20of%20LISP%20%28LISt%20Processing%29%20Language.md) <a id="holding"></a> ## Other versions with matching text [GstarCAD 2011](../../../../2011/Developer%20Reference/AutoLISP%20Reference/LISP%20Functions/%28close%20file-descriptor%29.md)