File.Exist

Syntax:

Exist()

Returned value:

Type: Boolean.
True - file exists; False - otherwise.

Description:

Defines whether or not a file exists, which matches the given object.

Availability:

Thin client, web-client, server, thick client, external connection, Mobile application (client), Mobile application (server).

Note:

To use the method on the web-client, you should preliminarily attach the extension for working with files.

Example:

Function CheckExistenceOfCatalogue(CatalogFilesName) Export
    DiskCatalogue = New File(CatalogFilesName);
    If 
DiskCatalogue.Exist() Then
        Return True;
    Else
        Answer = DoQueryBox("Catalog doesn't exist. Create it?", 
                        QuestionDialogMode.OKCancel);
        If 
Answer = DialogReturnCode.OK Then
            CreateDirectory(CatalogFilesName);
            Return 
True;
        Else
            Return False;
        EndIf
;
    EndIf
;
EndFunction

See also:

File, method BeginCheckingExistence

    

1C:Enterprise Developer's Community