summaryrefslogtreecommitdiffstats
path: root/source/text/sbasic/shared/03/sf_filesystem.xhp
blob: 18b36a4b99d569693594f179828beff3082ee4eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">
<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
-->

<meta>
  <topic id="SF_FileSystem" indexer="include" status="PUBLISH">
    <title id="tit" xml-lang="en-US">ScriptForge.FileSystem service</title>
    <filename>/text/sbasic/shared/03/sf_filesystem.xhp</filename>
  </topic>
</meta>

<body>
<section id="ScriptForge-sf_filesystem">
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id41582391760252">
        <bookmark_value>FileSystem service</bookmark_value>
    </bookmark>
</section>

<section id="abstract">
  <h1 id="bm_id781582391760253" xml-lang="en-US"><variable id="FileSystemService"><link href="text/sbasic/shared/03/sf_filesystem.xhp" name="FileSystem service"><literal>ScriptForge</literal>.<literal>FileSystem</literal> service</link></variable></h1>
  <paragraph role="paragraph" id="par_id931583589764919" xml-lang="en-US">The <literal>FileSystem</literal> service includes routines to handle files and folders. Next are some examples of the features provided by this service:</paragraph>
  <list type="unordered">
    <listitem>
      <paragraph id="par_id121612917070593" role="listitem">Verify whether a file or folder exists.</paragraph>
    </listitem>
    <listitem>
      <paragraph id="par_id121612917070594" role="listitem">Create and delete folders and files.</paragraph>
    </listitem>
    <listitem>
      <paragraph id="par_id121612917070595" role="listitem">Launch dialog boxes to open/save files.</paragraph>
    </listitem>
    <listitem>
      <paragraph id="par_id121612917070596" role="listitem">Access the list of files in a folder, etc.</paragraph>
    </listitem>
  </list>
</section>
  <note id="par_id121612917368946">The methods in the FileSystem service are mostly based on the <link href="https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1ucb_1_1XSimpleFileAccess.html" name="XSimpleFileAccess API"><literal>XSimpleFileAccess</literal> UNO interface.</link></note>

  <h2 id="hd_id961583589783025" xml-lang="en-US">Definitions</h2>
  <paragraph role="paragraph" id="par_id821612988815351">The table below lists the main parameters used by most of the methods in the <literal>FileSystem</literal> service.</paragraph>
  <table id="tab_id721612988600163">
   <tablerow>
       <tablecell>
           <paragraph id="par_id891612988600163" role="tablehead">Parameter</paragraph>
       </tablecell>
       <tablecell>
           <paragraph id="par_id711612988600163" role="tablehead">Description</paragraph>
       </tablecell>
   </tablerow>
   <tablerow>
       <tablecell>
           <paragraph id="par_id181612988600163" role="tablecontent" localize="false"><literal>FileName</literal></paragraph>
       </tablecell>
       <tablecell>
           <paragraph id="par_id321612988600163" role="tablecontent">The full name of the file including the path without a path separator at the end.</paragraph>
       </tablecell>
   </tablerow>
   <tablerow>
       <tablecell>
           <paragraph id="par_id181612988600164" role="tablecontent" localize="false"><literal>FolderName</literal></paragraph>
       </tablecell>
       <tablecell>
           <paragraph id="par_id321612988600165" role="tablecontent">The full name of the folder including the path. It may or may not contain the ending path separator.</paragraph>
       </tablecell>
   </tablerow>
   <tablerow>
       <tablecell>
           <paragraph id="par_id181612988600166" role="tablecontent" localize="false"><literal>Name</literal></paragraph>
       </tablecell>
       <tablecell>
           <paragraph id="par_id321612988600167" role="tablecontent">The last component of the <emph>Folder Name</emph> or <emph>File Name</emph> including its extension. This parameter is always expressed using the native format of the operating system.</paragraph>
       </tablecell>
   </tablerow>
   <tablerow>
       <tablecell>
           <paragraph id="par_id181612988600168" role="tablecontent" localize="false"><literal>BaseName</literal></paragraph>
       </tablecell>
       <tablecell>
           <paragraph id="par_id321612988600169" role="tablecontent">The last component of the <emph>Folder Name</emph> or <emph>File Name</emph> without its extension.</paragraph>
       </tablecell>
   </tablerow>
   <tablerow>
       <tablecell>
           <paragraph id="par_id181612988600171" role="tablecontent" localize="false"><literal>NamePattern</literal></paragraph>
       </tablecell>
       <tablecell>
           <paragraph id="par_id321612988600172" role="tablecontent">Any of the above names containing wildcards in its last component. Admitted wildcards are:</paragraph>
           <list type="unordered">
           <listitem>
             <paragraph id="par_id851583590809104"  role="listitem" xml-lang="en-US">"?" represents any single character</paragraph>
           </listitem>
           <listitem>
             <paragraph id="par_id161583590819320"  role="listitem" xml-lang="en-US">"*" represents zero, one, or multiple characters</paragraph>
           </listitem>
           </list>
       </tablecell>
   </tablerow>
  </table>
  <tip id="par_id911584540527980" xml-lang="en-US">The <literal>FileSystem</literal> service allows to perform operations over multiple files at the same time. By using name patterns, user scripts can copy, move or delete multiple files. Conversely, Basic built-in methods can only handle single files.</tip>

    <h3 id="hd_id991612918109871">File Naming Notation</h3>
    <paragraph role="paragraph" id="par_id791612918141083">The notation used to express file and folder names, both for arguments and returned values, is defined by the <literal>FileNaming</literal> property of the <literal>FileSystem</literal> service.</paragraph>
    <paragraph role="paragraph" id="par_id951612918220255">In short, the possible representation types are "URL" (URL file notation), "SYS" (operating system notation) and "ANY" (default). See more information <link href="text/sbasic/shared/03/sf_filesystem.xhp#properties" name="Properties Table">below</link>.</paragraph>
    <tip id="par_id861583589907100" xml-lang="en-US">An example of the URL notation is <emph>file:///C:/Documents/my_file.odt</emph>. Whenever possible consider using the URL notation because it is a more portable alternative.</tip>

    <h2 id="hd_id581582885621841" xml-lang="en-US">Service invocation</h2>
    <paragraph role="paragraph" id="par_id141610734722352">Before using the <literal>FileSystem</literal> service the <literal>ScriptForge</literal> library needs to be loaded using:</paragraph>
      <bascode>
        <paragraph role="bascode" localize="false" id="bas_id551610734764343">GlobalScope.BasicLibraries.LoadLibrary("ScriptForge")</paragraph>
      </bascode>
    <paragraph role="paragraph" id="par_id691612990276070">The following code snippet invokes the <literal>FileSystem</literal> service. The method <literal>BuildPath</literal> was used as an example.</paragraph>
    <bascode>
      <paragraph role="bascode" localize="false" id="bas_id371582885621964">Dim FSO As Variant</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id201582885621287">FSO = CreateScriptService("FileSystem")</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id901612990364784">FSO.BuildPath(...)</paragraph>
    </bascode>
    <embed href="text/sbasic/shared/00000003.xhp#Python_Support"/>

    <bookmark xml-lang="en-US" branch="index" id="bm_id901612991354326" localize="false">
      <bookmark_value>FileSystem service;FileNaming property</bookmark_value>
      <bookmark_value>FileSystem service;ConfigFolder property</bookmark_value>
      <bookmark_value>FileSystem service;ExtensionsFolder property</bookmark_value>
      <bookmark_value>FileSystem service;HomeFolder property</bookmark_value>
      <bookmark_value>FileSystem service;InstallFolder property</bookmark_value>
      <bookmark_value>FileSystem service;TemplatesFolder property</bookmark_value>
      <bookmark_value>FileSystem service;TemporaryFolder property</bookmark_value>
      <bookmark_value>FileSystem service;UserTemplatesFolder property</bookmark_value>
    </bookmark>
    <h2 id="hd_id651583668365757" xml-lang="en-US">Properties</h2>
    <section id="properties">
     <table id="tab_id381583668386455">
        <tablerow>
            <tablecell>
                <paragraph id="par_id871583668386455" role="tablehead" xml-lang="en-US">Name</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id491583668386455" role="tablehead" xml-lang="en-US">Readonly</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id271583668474014" role="tablehead" xml-lang="en-US">Type</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id401583668386455" role="tablehead" xml-lang="en-US">Description</paragraph>
            </tablecell>
        </tablerow>
        <tablerow>
            <tablecell>
                <paragraph id="par_id151583668386455" role="tablecontent" xml-lang="en-US" localize="false">FileNaming</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id371583668519172" role="tablecontent" xml-lang="en-US">No</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id271583668386455" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id771583668386455" role="tablecontent" xml-lang="en-US">Sets or returns the current files and folders notation, either "ANY", "URL" or "SYS":</paragraph>
                <list type="unordered">
                    <listitem>
                        <paragraph role="paragraph" id="par_id881585396501844" xml-lang="en-US"><emph>"ANY"</emph>: (default) the methods of the <literal>FileSystem</literal> service accept both URL and current operating system's notation for input arguments but always return URL strings.</paragraph>
                    </listitem>
                    <listitem>
                        <paragraph role="paragraph" id="par_id261583669091722" xml-lang="en-US"><emph>"URL"</emph>: the methods of the <literal>FileSystem</literal> service expect URL notation for input arguments and return URL strings.</paragraph>
                    </listitem>
                    <listitem>
                        <paragraph role="paragraph" id="par_id731583669120436" xml-lang="en-US"><emph>"SYS"</emph>: the methods of the <literal>FileSystem</literal> service expect current operating system's notation for both input arguments and return strings.</paragraph>
                    </listitem>
                </list>
                <paragraph role="paragraph" id="par_id211583765169579" xml-lang="en-US">Once set, the <literal>FileNaming</literal> property remains unchanged either until the end of the %PRODUCTNAME session or until it is set again.</paragraph>
            </tablecell>
        </tablerow>
        <tablerow>
            <tablecell>
                <paragraph id="par_id951583839708571" role="tablecontent" xml-lang="en-US" localize="false">ConfigFolder</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id541583839708548" role="tablecontent" xml-lang="en-US">Yes</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id751583839708362" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id731583839708412" role="tablecontent" xml-lang="en-US">Returns the configuration folder of %PRODUCTNAME.</paragraph>
            </tablecell>
        </tablerow>
        <tablerow>
            <tablecell>
                <paragraph id="par_id511584027709311" role="tablecontent" xml-lang="en-US" localize="false">ExtensionsFolder</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id761584027709516" role="tablecontent" xml-lang="en-US">Yes</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id491584027709825" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id971584027709752" role="tablecontent" xml-lang="en-US">Returns the folder where extensions are installed.</paragraph>
            </tablecell>
        </tablerow>
        <tablerow>
            <tablecell>
                <paragraph id="par_id491583839767611" role="tablecontent" xml-lang="en-US" localize="false">HomeFolder</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id31583839767743" role="tablecontent" xml-lang="en-US">Yes</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id741583839767926" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id111583839767195" role="tablecontent" xml-lang="en-US">Returns the user home folder.</paragraph>
            </tablecell>
        </tablerow>
        <tablerow>
            <tablecell>
                <paragraph id="par_id83158383992056" role="tablecontent" xml-lang="en-US" localize="false">InstallFolder</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id771583839920487" role="tablecontent" xml-lang="en-US">Yes</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id971583839920282" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id451583839920858" role="tablecontent" xml-lang="en-US">Returns the installation folder of %PRODUCTNAME.</paragraph>
            </tablecell>
        </tablerow>
        <tablerow>
            <tablecell>
                <paragraph id="par_id751588333908795" role="tablecontent" xml-lang="en-US" localize="false">TemplatesFolder</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id571588333908716" role="tablecontent" xml-lang="en-US">Yes</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id781588333908500" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id721588333908708" role="tablecontent" xml-lang="en-US">Returns the folder containing the system templates files.</paragraph>
            </tablecell>
        </tablerow>
        <tablerow>
            <tablecell>
                <paragraph id="par_id251583774433989" role="tablecontent" xml-lang="en-US" localize="false">TemporaryFolder</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id501583774433513" role="tablecontent" xml-lang="en-US">Yes</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id411583774433779" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id71583774433459" role="tablecontent" xml-lang="en-US">Returns the temporary files folder defined in the %PRODUCTNAME path settings.</paragraph>
            </tablecell>
        </tablerow>
        <tablerow>
            <tablecell>
                <paragraph id="par_id731588334016220" role="tablecontent" xml-lang="en-US" localize="false">UserTemplatesFolder</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id271588334016191" role="tablecontent" xml-lang="en-US">Yes</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id991588334016273" role="tablecontent" xml-lang="en-US" localize="false">String</paragraph>
            </tablecell>
            <tablecell>
                <paragraph id="par_id251588334016874" role="tablecontent" xml-lang="en-US">Returns the folder containing the user-defined template files.</paragraph>
            </tablecell>
        </tablerow>
    </table>
   </section>

<table id="tab_id501611613601554">
   <tablerow>
     <tablecell colspan="3"><paragraph id="par_id891611613601554" role="tablehead">List of Methods in the FileSystem Service</paragraph></tablecell>
   </tablerow>
   <tablerow>
       <tablecell>
           <paragraph id="par_id891611613601556" role="tablecontent" localize="false">
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#BuildPath" name="BuildPath method">BuildPath</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#CompareFiles" name="CompareFiles method">CompareFiles</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#CopyFile" name="CopyFile method">CopyFile</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#CopyFolder" name="CopyFolder method">CopyFolder</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#CreateFolder" name="CreateFolder method">CreateFolder</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#CreateTextFile" name="CreateTextFile method">CreateTextFile</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#DeleteFile" name="DeleteFile method">DeleteFile</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#DeleteFolder" name="DeleteFolder method">DeleteFolder</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#FileExists" name="FileExists method">FileExists</link><br/>
           </paragraph>
       </tablecell>
       <tablecell>
           <paragraph id="par_id541611613601554" role="tablecontent" localize="false">
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#Files" name="Files method">Files</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#FolderExists" name="FolderExists method">FolderExists</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#GetBaseName" name="GetBaseName method">GetBaseName</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#GetExtension" name="GetExtension method">GetExtension</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#GetFileLen" name="GetFileLen method">GetFileLen</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#GetFileModified" name="GetFileModified method">GetFileModified</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#GetName" name="GetName method">GetName</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#GetParentFolderName" name="GetParentFolderName method">GetParentFolderName</link><br/><br/>
           </paragraph>
       </tablecell>
       <tablecell>
           <paragraph id="par_id701611613601554" role="tablecontent" localize="false">
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#GetTempName" name="GetTempName method">GetTempName</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#HashFile" name="HashFile method">HashFile</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#MoveFile" name="MoveFile method">MoveFile</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#MoveFolder" name="MoveFolder method">MoveFolder</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#OpenTextFile" name="OpenTextFile method">OpenTextFile</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#PickFile" name="PickFile method">PickFile</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#PickFolder" name="PickFolder method">PickFolder</link><br/>
             <link href="text/sbasic/shared/03/sf_filesystem.xhp#SubFolders" name="SubFolders method">SubFolders</link><br/><br/>
           </paragraph>
       </tablecell>
   </tablerow>
</table>

<section id="BuildPath">
  <comment> BuildPath -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id721583933076548">
        <bookmark_value>FileSystem service;BuildPath</bookmark_value>
    </bookmark>
    <h2 id="hd_id681583933076692" localize="false">BuildPath</h2>
    <paragraph role="paragraph" id="par_id871583933076448">Joins a folder path and the name of a file and returns the full file name with a valid path separator. The path separator is added only if necessary.</paragraph>
    <h3 id="hd_id61583933076171" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id731583933076815">FSO.BuildPath(FolderName As String, Name As String) As String</paragraph>
    </bascode>
    <h3 id="hd_id321583933076658" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id90158393307695"><emph>FolderName</emph>: The path with which <literal>Name</literal> will be combined. The specified path does not need to be an existing folder.</paragraph>
    <paragraph role="paragraph" id="par_id891583933076975"><emph>Name</emph>: The name of the file to be appended to <literal>FolderName</literal>. This parameter uses the notation of the current operating system.</paragraph>
    <h3 id="hd_id26158393307687" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
      <paragraph role="bascode" localize="false" id="bas_id571583933076688">Dim FSO : FSO = CreateScriptService("FileSystem")</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id271583933076624">FSO.FileNaming = "URL"</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id531583933076390">MsgBox FSO.BuildPath("file:///home/user", "sample file.odt")</paragraph>
      <paragraph role="bascode" localize="false" id="bas_id591583933645158">'file:///home/user/sample%20file.odt</paragraph>
    </bascode>
</section>

<section id="CompareFiles">
    <comment> CompareFiles -------------------------------------------------------------------------------------------------------------------------- </comment>
      <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id141601118910914">
          <bookmark_value>FileSystem service;CompareFiles</bookmark_value>
      </bookmark>
      <h2 id="hd_id441601118910655" localize="false">CompareFiles</h2>
      <paragraph role="paragraph" id="par_id33160111891079">Compares two files and returns <literal>True</literal> when they seem identical.</paragraph>
      <paragraph role="paragraph" id="par_id631601119001315" xml-lang="en-US">Depending on the value of the <literal>CompareContents</literal> argument, the comparison between both files can be either based only on file attributes (such as the last modified date), or based on the file contents.</paragraph>
      <h3 id="hd_id91601118910918" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
      <bascode>
          <paragraph role="bascode" localize="false" id="bas_id401601118910956">FSO.CompareFiles(FileName1 As String, FileName2 As String, [CompareContents As Boolean]) As Boolean</paragraph>
      </bascode>
      <h3 id="hd_id641601118910334" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
      <paragraph role="paragraph" id="par_id481601118910755"><emph>FileName1, FileName2</emph>: The files to compare.</paragraph>
      <paragraph role="paragraph" id="par_id111601118910848" xml-lang="en-US"><emph>CompareContents</emph>: When <literal>True</literal>, the contents of the files are compared (default = <literal>False</literal>).</paragraph>
      <h3 id="hd_id421601118910835" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
      <bascode>
        <paragraph role="bascode" localize="false" id="bas_id231601118910666">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id101601118910778">If FSO.CompareFiles("C:\myFile1.txt", "C:\myFile2.txt", CompareContents := False) Then</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id171601123413866">    ...</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id271612997571657">End If</paragraph>
      </bascode>
</section>

<section id="CopyFile">
  <comment> CopyFile -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id41584541257826">
        <bookmark_value>FileSystem service;CopyFile</bookmark_value>
    </bookmark>
    <h2 id="hd_id95158454125767" localize="false">CopyFile</h2>
    <paragraph role="paragraph" id="par_id161584541257982">Copies one or more files from one location to another. Returns <literal>True</literal> if at least one file has been copied or <literal>False</literal> if an error occurred.</paragraph>
    <paragraph role="paragraph" id="par_id401612998805699">An error will also occur if the <literal>Source</literal> parameter uses wildcard characters and does not match any files.</paragraph>
    <paragraph role="paragraph" id="par_id331612998814805">The method stops immediately after it encounters an error. The method does not roll back nor does it undo changes made before the error occurred.</paragraph>
    <h3 id="hd_id601584541257443" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id201584541257726">FSO.CopyFile(Source As String, Destination As String, [Overwrite As Boolean]) As Boolean</paragraph>
    </bascode>
    <h3 id="hd_id291584541257237" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id1001584541257789"><emph>Source</emph>: It can be a <literal>FileName</literal> or a <literal>NamePattern</literal> indicating one or more files to be copied.</paragraph>
    <paragraph role="paragraph" id="par_id111584542310166" xml-lang="en-US"><emph>Destination</emph>: It can be either a <literal>FileName</literal> specifying where the single <literal>Source</literal> file is to be copied, or a <literal>FolderName</literal> into which the multiple files from <literal>Source</literal> are to be copied.</paragraph>
    <list type="unordered">
      <listitem>
        <paragraph role="paragraph" id="par_id491612999134752">If <literal>FolderName</literal> does not exist, it is created.</paragraph>
      </listitem>
      <listitem>
        <paragraph role="paragraph" id="par_id591612999166788">Wildcard characters are not allowed in <literal>Destination</literal>.</paragraph>
      </listitem>
    </list>
    <paragraph role="paragraph" id="par_id251584542431558" xml-lang="en-US"><emph>Overwrite</emph>: If <literal>True</literal> (default), files may be overwritten. The method will fail if <literal>Destination</literal> is readonly, regardless of the value specified in <literal>Overwrite</literal>.</paragraph>
    <h3 id="hd_id32158454125769" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id51584882315776">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" id="bas_id211613000903194">' Copies a single file</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id851613000918341">FSO.CopyFile("C:\Documents\my_file.odt", "C:\Temp\copied_file.odt")</paragraph>
        <paragraph role="bascode" id="bas_id841584541257574">' Copies multiple files. Only files are copied, subfolders are not.</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id501584541257221">FSO.CopyFile("C:\Documents\*.*", "C:\Temp\", Overwrite := False)</paragraph>
    </bascode>
</section>

<section id="CopyFolder">
  <comment> CopyFolder -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id661584544734386">
        <bookmark_value>FileSystem service;CopyFolder</bookmark_value>
    </bookmark>
    <h2 id="hd_id201584544734113" localize="false">CopyFolder</h2>
    <paragraph role="paragraph" id="par_id731584544734412">Copies one or more folders from one location to another. Returns <literal>True</literal> if at least one folder has been copied or <literal>False</literal> if an error occurred.</paragraph>
    <paragraph role="paragraph" id="par_id21612999775377">An error will also occur if the <literal>Source</literal> parameter uses wildcard characters and does not match any folders.</paragraph>
    <paragraph role="paragraph" id="par_id701612999808912">The method stops immediately after it encounters an error. The method does not roll back nor does it undo changes made before the error occurred.</paragraph>
    <h3 id="hd_id101584544734915" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id351584544734991">FSO.CopyFolder(Source As String, Destination As String, [Overwrite As Boolean]) As Boolean</paragraph>
    </bascode>
    <h3 id="hd_id81584544734599" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id851584544734202"><emph>Source</emph>: It can be a <literal>FolderName</literal> or a <literal>NamePattern</literal> indicating one or more folders to be copied.</paragraph>
    <paragraph role="paragraph" id="par_id321584544734273" xml-lang="en-US"><emph>Destination</emph>: Specifies the <literal>FolderName</literal> into which the single or multiple folders defined in <literal>Source</literal> are to be copied.</paragraph>
    <list type="unordered">
      <listitem>
        <paragraph role="paragraph" id="par_id491612999134762">If <literal>FolderName</literal> does not exist, it is created.</paragraph>
      </listitem>
      <listitem>
        <paragraph role="paragraph" id="par_id591612999166740">Wildcard characters are not allowed in <literal>Destination</literal>.</paragraph>
      </listitem>
    </list>
    <paragraph role="paragraph" id="par_id251584542431525" xml-lang="en-US"><emph>Overwrite</emph>: If <literal>True</literal> (default), files may be overwritten. The method will fail if <literal>Destination</literal> is readonly, regardless of the value specified in <literal>Overwrite</literal>.</paragraph>
    <h3 id="hd_id961584544734150" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id761584882338442">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id651584544734985">FSO.CopyFolder("C:\Documents\*", "C:\Temp\", Overwrite := False)</paragraph>
        <paragraph role="bascode" id="bas_id541584544734497">' Folders, their files and their subfolders are copied</paragraph>
    </bascode>
</section>

<section id="CreateFolder">
  <comment> CreateFolder -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id95158454067521">
        <bookmark_value>FileSystem service;CreateFolder</bookmark_value>
    </bookmark>
    <h2 id="hd_id501584540675285" localize="false">CreateFolder</h2>
    <paragraph role="paragraph" id="par_id31158454067562">Creates the specified <literal>FolderName</literal>. Returns <literal>True</literal> if the folder could be successfully created.</paragraph>
    <paragraph role="paragraph" id="par_id431613000475359">If the specified folder has a parent folder that does not exist, it is created.</paragraph>
    <h3 id="hd_id801584540675266" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id311584540675905">FSO.CreateFolder(FolderName As String) As Boolean</paragraph>
    </bascode>
    <h3 id="hd_id2158454067534" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id491584540675469"><emph>FolderName</emph>: A string representing the folder to be created. If the folder already exists, an exception will be raised.</paragraph>
    <h3 id="hd_id16158454067562" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id441584540675381">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id491584540675179">FSO.CreateFolder("C:\NewFolder\")</paragraph>
    </bascode>
</section>

<section id="CreateTextFile">
  <comment> CreateTextFile -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id651585322689546">
        <bookmark_value>FolderSystem service;CreateTextFile</bookmark_value>
    </bookmark>
    <h2 id="hd_id19158532268911" localize="false">CreateTextFile</h2>
    <paragraph role="paragraph" id="par_id731585322689518">Creates a specified file and returns a <literal>TextStream</literal> object that can be used to write to the file.</paragraph>
    <paragraph role="paragraph" id="par_id821613001057759">The method returns a <literal>Null</literal> object if an error occurred.</paragraph>
    <h3 id="hd_id601585322689682" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id29158532268984">FSO.CreateTextFile(FileName As String, [Overwrite As Boolean], [Encoding As String]) As Object</paragraph>
    </bascode>
    <h3 id="hd_id831585322689487" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id901585322689715"><emph>FileName</emph>: The name of the file to be created.</paragraph>
    <paragraph role="paragraph" id="par_id501585322689209" xml-lang="en-US"><emph>Overwrite</emph>: Boolean value that determines if <literal>FileName</literal> can be overwritten (default = <literal>True</literal>).</paragraph>
    <paragraph role="paragraph" id="par_id551585322689192" xml-lang="en-US"><emph>Encoding</emph>: The character set to be used. The default encoding is "UTF-8".</paragraph>
    <h3 id="hd_id601585322689988" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id291585322689770">Dim myFile As Object</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id541585322689351">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id51585322689982">Set myFile = FSO.CreateTextFile("C:\Temp\ThisFile.txt", Overwrite := True)</paragraph>
    </bascode>
    <note id="par_id141613001281573">To learn more about the names of character sets, visit <link href="https://www.iana.org/assignments/character-sets/character-sets.xhtml" name="Character Sets">IANA's Character Set</link> page. Beware that %PRODUCTNAME does not implement all existing character sets.</note>
</section>

<section id="DeleteFile">
  <comment> DeleteFile -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id421584882040621">
        <bookmark_value>FileSystem service;DeleteFile</bookmark_value>
    </bookmark>
    <h2 id="hd_id191584882040749" localize="false">DeleteFile</h2>
    <paragraph role="paragraph" id="par_id11584882040881">Deletes one or more files. Returns <literal>True</literal> if at least one file has been deleted or <literal>False</literal> if an error occurred.</paragraph>
    <paragraph role="paragraph" id="par_id21612999775356">An error will also occur if the <literal>FileName</literal> parameter uses wildcard characters and does not match any files.</paragraph>
    <paragraph role="paragraph" id="par_id21613001848493">The files to be deleted must not be readonly.</paragraph>
    <paragraph role="paragraph" id="par_id701612999808832">The method stops immediately after it encounters an error. The method does not roll back nor does it undo changes made before the error occurred.</paragraph>
    <h3 id="hd_id731584882040846" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id991584882040438">FSO.DeleteFile(FileName As String) As Boolean</paragraph>
    </bascode>
    <h3 id="hd_id821584882040911" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id441584882040860"><emph>FileName</emph>: It can be a <literal>FileName</literal> or a <literal>NamePattern</literal> indicating one or more files to be deleted.</paragraph>
    <h3 id="hd_id591584882040902" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id321584882040274">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id501584882040356">FSO.DeleteFile("C:\Temp\*.docx")</paragraph>
        <paragraph role="bascode" id="bas_id181584882040535">' Only files are deleted, subfolders are not</paragraph>
    </bascode>
</section>

<section id="DeleteFolder">
  <comment> DeleteFolder -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id91584882542710">
        <bookmark_value>FileSystem service;DeleteFolder</bookmark_value>
    </bookmark>
    <h2 id="hd_id151584882542309" localize="false">DeleteFolder</h2>
    <paragraph role="paragraph" id="par_id11584882015881">Deletes one or more folders. Returns <literal>True</literal> if at least one folder has been deleted or <literal>False</literal> if an error occurred.</paragraph>
    <paragraph role="paragraph" id="par_id21612999775346">An error will also occur if the <literal>FolderName</literal> parameter uses wildcard characters and does not match any folders.</paragraph>
    <paragraph role="paragraph" id="par_id21613001848853">The folders to be deleted must not be readonly.</paragraph>
    <paragraph role="paragraph" id="par_id701612999808842">The method stops immediately after it encounters an error. The method does not roll back nor does it undo changes made before the error occurred.</paragraph>
    <h3 id="hd_id441584882542432" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id851584882542512">FSO.DeleteFolder(FolderName As String) As Boolean</paragraph>
    </bascode>
    <h3 id="hd_id641584882542272" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id451584882542247"><emph>FolderName</emph>: It can be a <literal>FolderName</literal> or a <literal>NamePattern</literal> indicating one or more folders to be deleted.</paragraph>
    <h3 id="hd_id391584882542428" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id751584882542695">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id611584882542154">FSO.DeleteFolder("C:\Temp\*")</paragraph>
        <paragraph role="bascode" id="bas_id491584882542177">' Only folders are deleted, files in the top folder (C:\Temp\) are not</paragraph>
    </bascode>
</section>

<section id="FileExists">
  <comment> FileExists -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id571583764426508">
        <bookmark_value>FileSystem service;FileExists</bookmark_value>
    </bookmark>
    <h2 id="hd_id39158376442641" localize="false">FileExists</h2>
    <paragraph role="paragraph" id="par_id161583764426709">Returns <literal>True</literal> if a given file name is valid and exists, otherwise the method returns <literal>False</literal>.</paragraph>
    <paragraph role="paragraph" id="par_id91613003122613">If the <literal>FileName</literal> parameter is actually an existing folder name, the method returns <literal>False</literal>.</paragraph>
    <h3 id="hd_id151583764426546" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id921583764426903">FSO.FileExists(FileName As String) As Boolean</paragraph>
    </bascode>
    <h3 id="hd_id641583764426186" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id361583764426547"><emph>FileName</emph>: A string representing the file to be tested.</paragraph>
    <h3 id="hd_id691583764426580" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id621583764787755">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id821583764426197">If FSO.FileExists("C:\Documents\my_file.odt") Then</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id191613003283635">    '...</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id891613003291580">End If</paragraph>
    </bascode>
</section>

<section id="Files">
  <comment> Files -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id771583944327771">
        <bookmark_value>FileSystem service;Files</bookmark_value>
    </bookmark>
    <h2 id="hd_id461583944327647" localize="false">Files</h2>
    <paragraph role="paragraph" id="par_id11158394432779">Returns a zero-based array of the files stored in a given folder. Each entry in the array is a string containing the full path and file name.</paragraph>
    <paragraph role="paragraph" id="par_id641613003790120">If <literal>FolderName</literal> does not exist, an exception is raised.</paragraph>
    <paragraph role="paragraph" id="par_id821613003779799">The resulting list may be filtered with wildcards.</paragraph>
    <h3 id="hd_id201583944327395" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id641583944327587">FSO.Files(FolderName As String, [Filter As String]) As Variant</paragraph>
    </bascode>
    <h3 id="hd_id41158394454325" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id731583944543140"><emph>FolderName</emph>: A string representing a folder. The folder must exist. <literal>FolderName</literal> must not designate a file.</paragraph>
    <paragraph role="paragraph" id="par_id591585648450060" xml-lang="en-US"><emph>Filter</emph>: A string containing wildcards ("?" and "*") that will be applied to the resulting list of files (default = "").</paragraph>
    <h3 id="hdid751583944327746" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id381583944327923">Dim filesList As Variant, file As String</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id581583944327968">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id451583944327508">filesList = FSO.Files("/home/user/", "*.txt")</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id521583944732086">For Each file In filesList</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id421583944743304">    ' ...</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id721583944748672">Next file</paragraph>
    </bascode>
</section>

<section id="FolderExists">
  <comment> FolderExists -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id11583765642643">
        <bookmark_value>FileSystem service;FolderExists</bookmark_value>
    </bookmark>
    <h2 id="hd_id421583765642360" localize="false">FolderExists</h2>
    <paragraph role="paragraph" id="par_id51583765642590">Returns <literal>True</literal> if the specified <literal>FolderName</literal> is valid and exists, otherwise the method returns <literal>False</literal>.</paragraph>
    <paragraph role="paragraph" id="par_id151613004111990">If the <literal>FolderName</literal> parameter is actually an existing file name, the method returns <literal>False</literal>.</paragraph>
    <h3 id="hd_id541583765642759" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id361583765642228">FSO.FolderExists(FolderName As String) As Boolean</paragraph>
    </bascode>
    <h3 id="hd_id301583765642930" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id1001583765642211"><emph>FolderName</emph>: A string representing the folder to be tested.</paragraph>
    <h3 id="hd_id331583765642394" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id301583765642138">FSO.FolderNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id771583765642330">If FSO.FolderExists("C:\Documents\Thesis") Then</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id21613004201438">    '...</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id861613004206334">End If</paragraph>
    </bascode>
</section>

<section id="GetBaseName">
  <comment> GetBaseName -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id54158411061866">
        <bookmark_value>FileSystem service;GetBaseName</bookmark_value>
    </bookmark>
    <h2 id="hd_id111584110618587" localize="false">GetBaseName</h2>
    <paragraph role="paragraph" id="par_id521584110618989">Returns the <literal>BaseName</literal> (equal to the last component) of a folder or file name, without its extension.</paragraph>
    <paragraph role="paragraph" id="par_id731613004316790">The method does not check if the specified file or folder exists.</paragraph>
    <h3 id="hd_id251584110618646" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id22158411061854">FSO.GetBaseName(FileName As String) As String</paragraph>
    </bascode>
    <h3 id="hd_id451584110618983" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id691584110618308"><emph>FileName</emph>: A string representing the file name and its path.</paragraph>
    <h3 id="hd_id48158411061852" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" id="bas_id861584110618986">' If the input parameter is a folder, it returns the last component of the path</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id201584110618266">MsgBox FSO.GetBaseName("/home/user/Documents") ' "Documents"</paragraph>
        <paragraph role="bascode" id="bas_id591613004793431">' If the input parameter is a file, the method returns the file name without the extension and the path</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id211584110618884">MsgBox FSO.GetBaseName("/home/user/Documents/my_file.ods") ' "my_file"</paragraph>
    </bascode>
</section>

<section id="GetExtension">
  <comment> GetExtension -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id271584032680645">
        <bookmark_value>FileSystem service;GetExtension</bookmark_value>
    </bookmark>
    <h2 id="hd_id441584032680932" localize="false">GetExtension</h2>
    <paragraph role="paragraph" id="par_id831584032680866">Returns the extension part of a file or folder name without the dot "." character.</paragraph>
    <paragraph role="paragraph" id="par_id941613060736524">The method does not check for the existence of the specified file or folder.</paragraph>
    <paragraph role="paragraph" id="par_id561613060896361">If this method is applied to a folder name or to a file without an extension, then an empty string is returned.</paragraph>
    <h3 id="hd_id19158403268038" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id571584032680636">FSO.GetExtension(FileName As String) As String</paragraph>
    </bascode>
    <h3 id="hd_id761584032680163" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id821584032680311"><emph>FileName</emph>: A string representing the file name and its path.</paragraph>
    <h3 id="hd_id631584032680726" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id241584032680600">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id651584032680887">MsgBox FSO.GetExtension("C:\Windows\Notepad.exe")  ' "exe"</paragraph>
    </bascode>
</section>

<section id="GetFileLen">
    <comment> GetFileLen -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id511600685050691">
        <bookmark_value>FileSystem service;GetFileLen</bookmark_value>
    </bookmark>
    <h2 id="hd_id301600685050869" localize="false">GetFileLen</h2>
    <paragraph role="paragraph" id="par_id48160068505010">The builtin <literal>FileLen</literal> Basic function returns the number of bytes contained in a file as a <literal>Long</literal> value, i.e. up to 2GB.</paragraph>
    <paragraph role="paragraph" id="par_id571613061005426">The <literal>GetFileLen</literal> method can handle files with much larger sizes by returning a <literal>Currency</literal> value.</paragraph>
    <h3 id="hd_id471600685050171" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id821600685050342">FSO.GetFileLen(FileName As String) As Currency</paragraph>
    </bascode>
    <h3 id="hd_id31600685050872" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id161600685050367"><emph>FileName</emph>: A string representing an existing file.</paragraph>
    <h3 id="hd_id831600685050271" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id901600685050677">Dim a As Currency</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id721600685050519">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id961600685050123">a = FSO.GetFileLen("C:\pagefile.sys")</paragraph>
    </bascode>
</section>

<section id="GetFileModified">
  <comment> GetFileModified -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id901584811478304">
        <bookmark_value>FileSystem service;GetFileModified</bookmark_value>
    </bookmark>
    <h2 id="hd_id651584811478113" localize="false">GetFileModified</h2>
    <paragraph role="paragraph" id="par_id191584811478936">Returns the last modified date of a given file.</paragraph>
    <h3 id="hd_id831584811478834" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id521584811478511">FSO.GetFileModified(FileName As String) As Date</paragraph>
    </bascode>
    <h3 id="hd_id271584811478116" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id25158481147822"><emph>FileName</emph>: A string representing an existing file.</paragraph>
    <h3 id="hd_id811584811478741" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id911584811636241">Dim a As Date</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id351584811478870">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id111584811478888">a = FSO.GetFileModified("C:\Documents\my_file.odt")</paragraph>
    </bascode>
</section>

<section id="GetName">
  <comment> GetName -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id501584032366770">
        <bookmark_value>FileSystem service;GetName</bookmark_value>
    </bookmark>
    <h2 id="hd_id761584032366379" localize="false">GetName</h2>
    <paragraph role="paragraph" id="par_id711584032366587">Returns the last component of a file or folder name in native operating system format.</paragraph>
    <paragraph role="paragraph" id="par_id541613061300811">The method does not check if the specified file or folder exists.</paragraph>
    <h3 id="hd_id801584032366162" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id321584032366710">FSO.GetName(FileName As String) As String</paragraph>
    </bascode>
    <h3 id="hd_id61584032366208" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id671584032366193"><emph>FileName</emph>: A string representing the file name and its path.</paragraph>
    <h3 id="hd_id141584032366384" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id381584032366430">Dim a As String</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id291584032366309">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id61158403236686">a = FSO.GetName("C:\Windows\Notepad.exe"  ' Notepad.exe</paragraph>
    </bascode>
</section>

<section id="GetParentFolderName">
  <comment> GetParentFolderName -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id211584113432829">
        <bookmark_value>FileSystem service;GetParentFolderName</bookmark_value>
    </bookmark>
    <h2 id="hd_id94158411343258" localize="false">GetParentFolderName</h2>
    <paragraph role="paragraph" id="par_id871584113432747">Returns a string containing the name of the parent folder of a specified file or folder name.</paragraph>
    <paragraph role="paragraph" id="par_id611613061603039">The method does not check if the specified file or folder exists.</paragraph>
    <h3 id="hd_id571584113432706" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id151584113432818">FSO.GetParentFolderName(FileName As String) As String</paragraph>
    </bascode>
    <h3 id="hd_id39158411343279" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id471584113432231"><emph>FileName</emph>: A string with the file or folder name to be analyzed.</paragraph>
    <h3 id="hd_id71584113432160" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id100158411343225">Dim a As String</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id241584113432211">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id161584113432533">a = FSO.GetParentFolderName("C:\Windows\Notepad.exe"  ' C:\Windows\</paragraph>
    </bascode>
</section>

<section id="GetTempName">
  <comment> GetTempName -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id621583851172862">
        <bookmark_value>FileSystem service;GetTempName</bookmark_value>
    </bookmark>
    <h2 id="hd_id981583851172348" localize="false">GetTempName</h2>
    <paragraph role="paragraph" id="par_id82158385117289">Returns a randomly generated temporary file name that is useful for performing operations that require a temporary file.</paragraph>
    <paragraph role="paragraph" id="par_id391613061770924">The returned file name does not have any suffix. The folder part of the returned string is the system's temporary folder.</paragraph>
    <paragraph role="paragraph" id="par_id971613061774934">The method does not create the temporary file.</paragraph>
    <h3 id="hd_id11583851172702" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id281583851172149">FSO.GetTempName() As String</paragraph>
    </bascode>
    <h3 id="hd_id381583851172892" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id41583851448294">Dim a As String</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id311583851172939">FSO.FolderNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id381583851172545">a = FSO.GetTempName() &amp; ".txt"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id381583851275546">' "/tmp/SF_574068.txt"</paragraph>
    </bascode>
</section>

<section id="HashFile">
    <comment> HashFile -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id771601042514294">
        <bookmark_value>FileSystem service;HashFile</bookmark_value>
    </bookmark>
    <h2 id="hd_id251601042514585" localize="false">HashFile</h2>
    <paragraph role="paragraph" id="par_id58160104251423">Hash functions are used by some cryptographic algorithms, in digital signatures, message authentication codes, fraud detection, fingerprints, checksums (message integrity check), hash tables, password storage and much more.</paragraph>
    <paragraph role="paragraph" id="par_id301601042791356" xml-lang="en-US">The <literal>HashFile</literal> method returns the result of a hash function, applied on a given file and using a specified algorithm. The returned value is a string of lower-case hexadecimal digits.</paragraph>
    <paragraph role="paragraph" id="par_id861601043268484" xml-lang="en-US">The hash algorithms supported are: <literal>MD5</literal>, <literal>SHA1</literal>, <literal>SHA224</literal>, <literal>SHA256</literal>, <literal>SHA384</literal> and <literal>SHA512</literal>.</paragraph>
    <h3 id="hd_id131601042514185" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id901601042514520">FSO.HashFile(FileName As String, Algorithm As String) As String</paragraph>
    </bascode>
    <h3 id="hd_id571601042514450" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id28160104251451"><emph>FileName</emph>: A string representing an existing file.</paragraph>
    <paragraph role="paragraph" id="par_id71601042959846" xml-lang="en-US"><emph>Algorithm</emph>: One of the supported algorithms.</paragraph>
    <h3 id="hd_id911601042514639" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id1160104251483">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id391601042514664">MsgBox FSO.HashFile("C:\pagefile.sys", "MD5")</paragraph>
    </bascode>
</section>

<section id="MoveFile">
  <comment> MoveFile -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id41584791330923">
        <bookmark_value>FileSystem service;MoveFile</bookmark_value>
    </bookmark>
    <h2 id="hd_id321584791330580" localize="false">MoveFile</h2>
    <paragraph role="paragraph" id="par_id51584791330688">Moves one or more files from one location to another. Returns <literal>True</literal> if at least one file has been moved or <literal>False</literal> if an error occurred.</paragraph>
    <paragraph role="paragraph" id="par_id631613062890648">An error will also occur if the <literal>Source</literal> parameter uses wildcard characters and does not match any files.</paragraph>
    <paragraph role="paragraph" id="par_id241613062902777">The method stops immediately after it encounters an error. The method does not roll back nor does it undo changes made before the error occurred.</paragraph>
    <h3 id="hd_id87158479133082" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id1001584791330829">FSO.MoveFile(Source As String, Destination As String) As Boolean</paragraph>
    </bascode>
    <h3 id="hd_id93158479133092" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id721584791330406"><emph>Source</emph>: It can be a <literal>FileName</literal> or <literal>NamePattern</literal> to designate one or more files to be moved.</paragraph>
    <paragraph role="paragraph" id="par_id291584791330181" xml-lang="en-US"><emph>Destination</emph>: If <literal>Source</literal> is a <literal>FileName</literal> then this parameter indicates the new path and file name of the moved file.</paragraph>
    <paragraph role="paragraph" id="par_id31613063334246">If the move operation involves multiple files, then <literal>Destination</literal> must be a folder name. If it does not exist, it is created.</paragraph>
    <paragraph role="paragraph" id="par_id391613063494599">If <literal>Source</literal> and <literal>Destination</literal> have the same parent folder, the method will rename the <literal>Source</literal>.</paragraph>
    <paragraph role="paragraph" id="par_id941613063476533">Wildcard characters are not allowed in <literal>Destination</literal>.</paragraph>
    <h3 id="hd_id451584791330878" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id211584791330821">Dim a As String</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id471584882463679">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id881584791330102">FSO.MoveFile("C:\Temp1\*.*", "C:\Temp2\")</paragraph>
        <paragraph role="bascode" id="bas_id331584791330495">' Only files are moved, subfolders are not</paragraph>
    </bascode>
</section>

<section id="MoveFolder">
  <comment> MoveFolder -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id141584791330310">
        <bookmark_value>FolderSystem service;MoveFolder</bookmark_value>
    </bookmark>
    <h2 id="hd_id221584791330200" localize="false">MoveFolder</h2>
    <paragraph role="paragraph" id="par_id301584791330868">Moves one or more folders from one location to another. Returns <literal>True</literal> if at least one folder has been moved or <literal>False</literal> if an error occurred.</paragraph>
    <paragraph role="paragraph" id="par_id411613072570664">An error will also occur if the <literal>Source</literal> parameter uses wildcard characters and does not match any folders.</paragraph>
    <paragraph role="paragraph" id="par_id601613072595264">The method stops immediately after it encounters an error. The method does not roll back nor does it undo changes made before the error occurred.</paragraph>
    <h3 id="hd_id441584791330489" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id301584791330135">FSO.MoveFolder(Source As String, Destination As String) As Boolean</paragraph>
    </bascode>
    <h3 id="hd_id931584791330194" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id541584791330777"><emph>Source</emph>: It can be a <literal>FolderName</literal> or <literal>NamePattern</literal> to designate one or more folders to be moved.</paragraph>
    <paragraph role="paragraph" id="par_id551584791330279" xml-lang="en-US"><emph>Destination</emph>: If the move operation involves a single folder, then <literal>Destination</literal> is the name and path of the moved folder and it must not exist.</paragraph>
    <paragraph role="paragraph" id="par_id11613072890641">If multiple folders are being moved, then <literal>Destination</literal> designates where the folders in <literal>Source</literal> will be moved into. If <literal>Destination</literal> does not exist, it is created.</paragraph>
    <paragraph role="paragraph" id="par_id301613072928159">Wildcard characters are not allowed in <literal>Destination</literal>.</paragraph>
    <h3 id="hd_id631584791330660" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id1001584791330720">Dim a As String</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id291584882448172">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id201584791330500">FSO.MoveFolder("C:\Temp1\*", "C:\Temp2\")</paragraph>
    </bascode>
</section>

<section id="OpenTextFile">
  <comment> OpenTextFile -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id531585320922937">
        <bookmark_value>FolderSystem service;OpenTextFile</bookmark_value>
    </bookmark>
    <h2 id="hd_id481585320922643" localize="false">OpenTextFile</h2>
    <paragraph role="paragraph" id="par_id121585320922117">Opens a file and returns a <literal>TextStream</literal> object that can be used to read from, write to, or append to the file.</paragraph>
    <paragraph role="paragraph" id="par_id591613073104711">Note that the method does not check if the given file is really a text file.</paragraph>
    <paragraph role="paragraph" id="par_id951613073135036">The method returns a <literal>Null</literal> object if an error occurred.</paragraph>
    <h3 id="hd_id231585320922972" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id541585320922330">FSO.OpenTextFile(FileName As String, [IOMode As Integer], [Create As Boolean], [Encoding As String]) As Object</paragraph>
    </bascode>
    <h3 id="hd_id561585320922459" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id551585320922678"><emph>FileName</emph>: Identifies the file to open.</paragraph>
    <paragraph role="paragraph" id="par_id671585320922388" xml-lang="en-US"><emph>IOMode</emph>: Indicates the input/output mode. It can be one of three constants: <literal>FSO.ForReading</literal> (default), <literal>FSO.ForWriting</literal>, or <literal>FSO.ForAppending</literal>.</paragraph>
    <paragraph role="paragraph" id="par_id21585321398586" xml-lang="en-US"><emph>Create</emph>: Boolean value that indicates whether a new file can be created if the specified filename doesn't exist:</paragraph>
    <list type="unordered">
      <listitem>
        <paragraph id="par_id721613073434797" role="listitem">If <literal>True</literal> a new file and its parent folders will be created if they do not exist;</paragraph>
      </listitem>
      <listitem>
        <paragraph id="par_id201613073469289" role="listitem">If <literal>False</literal> then new files are not created (default).</paragraph>
      </listitem>
    </list>
    <paragraph role="paragraph" id="par_id771585321576210" xml-lang="en-US"><emph>Encoding</emph>: The character set to be used. The default encoding is "UTF-8".</paragraph>
    <h3 id="hd_id791585320922270" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id841585320922219">Dim myFile As Object</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id831585320922237">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id141585320922524">Set myFile = FSO.OpenTextFile("C:\Temp\ThisFile.txt", FSO.ForReading)</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id341585321797611">If Not IsNull(myFile) Then</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id261585321805705">    ' ...</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id801613073013084">End If</paragraph>
    </bascode>
</section>

<section id="PickFile">
  <comment> PickFile -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id1001583670342501">
        <bookmark_value>FileSystem service;PickFile</bookmark_value>
    </bookmark>
    <h2 id="hd_id421583670342501" localize="false">PickFile</h2>
    <paragraph role="paragraph" id="par_id871583670342501">Opens a dialog box to open or save files.</paragraph>
    <paragraph role="paragraph" id="par_id881613074436979">If the <literal>SAVE</literal> mode is set and the picked file exists, a warning message will be displayed.</paragraph>
    <h3 id="hd_id381583670342502" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
      <paragraph role="bascode" localize="false" id="bas_id541583670342502">FSO.PickFile([DefaultFile As String], [Mode As String], [Filter As String]) As String</paragraph>
    </bascode>
    <h3 id="hd_id431583670342502" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id481583670342502"><emph>DefaultFile</emph>: This argument is a string composed of a folder and file name:</paragraph>
    <list type="unordered">
    <listitem>
        <paragraph id="par_id511613074665951" role="listitem">The folder part indicates the folder that will be shown when the dialog opens (default = the last selected folder).</paragraph>
    </listitem>
    <listitem>
        <paragraph id="par_id631613074685308" role="listitem">The file part designates the default file to open or save.</paragraph>
    </listitem>
    </list>
    <paragraph role="paragraph" id="par_id981583670342502"><emph>Mode</emph>: <literal>OPEN</literal> (input file) or <literal>SAVE</literal> (output file). The default value is <literal>OPEN</literal>.</paragraph>
    <paragraph role="paragraph" id="par_id31583670342502"><emph>Filter</emph>: The extension of the files displayed when the dialog is opened (default = no filter).</paragraph>
    <h3 id="hd_id421583670342502" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id411583670342503">Dim a As Variant</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id461583764819574">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id691583670342504">a = FSO.PickFile("C:\", "OPEN", "txt")</paragraph>
        <paragraph role="bascode" id="bas_id941583670925672">' Only *.txt files are displayed</paragraph>
    </bascode>
</section>

<section id="PickFolder">
  <comment> PickFolder -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id171583671701309">
        <bookmark_value>FileSystem service;PickFolder</bookmark_value>
    </bookmark>
    <h2 id="hd_id581583671701385" localize="false">PickFolder</h2>
    <paragraph role="paragraph" id="par_id521583671701777">Opens a dialog box to select a folder.</paragraph>
    <h3 id="hd_id941583671701398" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id31583671701808">FSO.PickFolder([DefaultFolder As String], [FreeText As String]) As String</paragraph>
    </bascode>
    <h3 id="hd_id601583671701437" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id951583671701872"><emph>DefaultFolder</emph>: A string containing the folder name that will be displayed when the dialog is opened (default = the last selected folder).</paragraph>
    <paragraph role="paragraph" id="par_id821583671701764"><emph>FreeText</emph>: Text to display in the dialog (default = "").</paragraph>
    <h3 id="hd_id511583671701308" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id21583671701795">Dim a As Variant</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id391583764844033">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" id="bas_id921583671701610">a = FSO.PickFolder("C:\", "Choose a folder or press Cancel")</paragraph>
    </bascode>
</section>

<section id="SubFolders">
  <comment> SubFolders -------------------------------------------------------------------------------------------------------------------------- </comment>
    <bookmark xml-lang="en-US" localize="false" branch="index" id="bm_id901584016761417">
        <bookmark_value>FileSystem service;Files</bookmark_value>
    </bookmark>
    <h2 id="hd_id51584016761775" localize="false">SubFolders</h2>
    <paragraph role="paragraph" id="par_id431584016761996">Returns a zero-based array of the folders stored in a given <literal>FolderName</literal>.</paragraph>
    <paragraph role="paragraph" id="par_id431613075267241">The list may be filtered with wildcards.</paragraph>
    <h3 id="hd_id741584016761670" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functsyntax"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id931584016761182">FSO.SubFolders(FolderName As String, [Filter As String]) As Variant</paragraph>
    </bascode>
    <h3 id="hd_id341584016761331" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functparameters"/></h3>
    <paragraph role="paragraph" id="par_id701584016761945"><emph>FolderName</emph>: A string representing a folder. The folder must exist. <literal>FolderName</literal> must not designate a file.</paragraph>
    <paragraph role="paragraph" id="par_id471585648674921" xml-lang="en-US"><emph>Filter</emph>: A string containing wildcards ("?" and "*") that will be applied to the resulting list of folders (default = "").</paragraph>
    <h3 id="hd_id921584016761389" localize="false"><embedvar href="text/sbasic/shared/00000003.xhp#functexample"/></h3>
    <bascode>
        <paragraph role="bascode" localize="false" id="bas_id541584016761911">Dim folderList As Variant, folder As String</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id391584016761116">FSO.FileNaming = "SYS"</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id701584016761482">folderList = FSO.SubFolders("/home/user/")</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id631584016761643">For Each folder In folderList</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id871584016761279">    ' ...</paragraph>
        <paragraph role="bascode" localize="false" id="bas_id881584016761778">Next folder</paragraph>
    </bascode>
</section>

  <embed href="text/sbasic/shared/03/lib_ScriptForge.xhp#SF_InternalUse"/>
  <section id="relatedtopics">
    <embed href="text/sbasic/shared/03/sf_textstream.xhp#TextStreamService"/>
    <paragraph role="paragraph" id="par_id301613075694148"><link href="text/sbasic/shared/03160000.xhp" name="Input function">Input Function</link></paragraph>
    <paragraph role="paragraph" id="par_id271612398715438"><link href="text/sbasic/shared/03020103.xhp" name="Open statement">Open Statement</link></paragraph>
  </section>
</body>
</helpdocument>