<div class="meta" robots="noindex">

</div>

Method

# FolderItem.OpenAsVirtualVolume

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r3. There is no replacement.

</div>

## Description

Attempts to open the **FolderItem** as a VirtualVolume. It returns `Nil</api/language/nil>` if the **FolderItem** is not a VirtualVolume.

## Notes

It is opened as Read/Write unless it is locked at the operating system level.

## Sample code

The following example reads a text file that was saved earlier. It is passed the name of the file.

``` xojo
Sub ReadTextFile(s As String)
  ' reads the text file in the VirtualVolume
  Var f, virtualFile As Folderitem
  Var v As VirtualVolume
  f = FolderItem.ShowOpenFileDialog("myVirtualVolume")
  If f <> Nil Then
    v = f.OpenAsVirtualVolume
    If v <> Nil Then
      virtualFile = v.Root.Child(s)
      If VirtualFile <> Nil Then
        Var stream As BinaryStream
        stream = BinaryStream.Open(virtualFile, False)
        Do
          TextArea2.AddText(stream.Read(255))
        Loop Until stream.EndOfFile
        stream.Close
      End If
    End If
  End If
End Sub
```

## Compatibility

All project types on all supported operating systems.
