Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,17 +0,0 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
|
||||
procedure File_Exists is
|
||||
function Does_File_Exist (Name : String) return Boolean is
|
||||
The_File : Ada.Text_IO.File_Type;
|
||||
begin
|
||||
Open (The_File, In_File, Name);
|
||||
Close (The_File);
|
||||
return True;
|
||||
exception
|
||||
when Name_Error =>
|
||||
return False;
|
||||
end Does_File_Exist;
|
||||
begin
|
||||
Put_Line (Boolean'Image (Does_File_Exist ("input.txt" )));
|
||||
Put_Line (Boolean'Image (Does_File_Exist ("\input.txt")));
|
||||
end File_Exists;
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
with Ada.Text_IO; use Ada.Text_IO;
|
||||
with Ada.Directories; use Ada.Directories;
|
||||
|
||||
procedure File_Exists is
|
||||
procedure Print_File_Exist (Name : String) is
|
||||
begin
|
||||
Put_Line ("Does " & Name & " exist? " &
|
||||
Boolean'Image (Exists (Name)));
|
||||
end Print_File_Exist;
|
||||
procedure Print_Dir_Exist (Name : String) is
|
||||
begin
|
||||
Put_Line ("Does directory " & Name & " exist? " &
|
||||
Boolean'Image (Exists (Name) and then Kind (Name) = Directory));
|
||||
end Print_Dir_Exist;
|
||||
begin
|
||||
Print_File_Exist ("input.txt" );
|
||||
Print_File_Exist ("/input.txt");
|
||||
Print_Dir_Exist ("docs");
|
||||
Print_Dir_Exist ("/docs");
|
||||
end File_Exists;
|
||||
|
|
@ -1,4 +1,19 @@
|
|||
if exist input.txt echo The following file called input.txt exists.
|
||||
if exist \input.txt echo The following file called \input.txt exists.
|
||||
if exist docs echo The following directory called docs exists.
|
||||
if exist \docs\ echo The following directory called \docs\ exists.
|
||||
@echo off
|
||||
call :fileexist input.txt
|
||||
call :fileexist \input.txt
|
||||
call :direxist docs
|
||||
call :direxist \docs
|
||||
goto :eof
|
||||
|
||||
:fileexist
|
||||
if exist %1\ call :printexist File %1 0&goto:eof
|
||||
if exist %1 call :printexist File %1 1&goto:eof
|
||||
call :printexist File %1 0&goto:eof
|
||||
|
||||
:direxist
|
||||
if exist %1\ call :printexist Directory %1 1&goto:eof
|
||||
call :printexist Directory %1 0&goto:eof
|
||||
|
||||
:printexist
|
||||
if %3 equ 0 (echo %1 %2 does not exist.) else (echo %1 %2 exists.)
|
||||
goto:eof
|
||||
|
|
|
|||
|
|
@ -1,70 +0,0 @@
|
|||
identification division.
|
||||
program-id. check-file-exist.
|
||||
|
||||
environment division.
|
||||
configuration section.
|
||||
repository.
|
||||
function all intrinsic.
|
||||
|
||||
data division.
|
||||
working-storage section.
|
||||
01 skip pic 9 value 2.
|
||||
01 file-name.
|
||||
05 value "/output.txt".
|
||||
01 dir-name.
|
||||
05 value "/docs/".
|
||||
01 unusual-name.
|
||||
05 value "Abdu'l-Bahá.txt".
|
||||
|
||||
01 test-name pic x(256).
|
||||
|
||||
01 file-handle usage binary-long.
|
||||
01 file-info.
|
||||
05 file-size pic x(8) comp-x.
|
||||
05 file-date.
|
||||
10 file-day pic x comp-x.
|
||||
10 file-month pic x comp-x.
|
||||
10 file-year pic xx comp-x.
|
||||
05 file-time.
|
||||
10 file-hours pic x comp-x.
|
||||
10 file-minutes pic x comp-x.
|
||||
10 file-seconds pic x comp-x.
|
||||
10 file-hundredths pic x comp-x.
|
||||
|
||||
procedure division.
|
||||
files-main.
|
||||
|
||||
*> check in current working dir
|
||||
move file-name(skip:) to test-name
|
||||
perform check-file
|
||||
|
||||
move dir-name(skip:) to test-name
|
||||
perform check-file
|
||||
|
||||
move unusual-name to test-name
|
||||
perform check-file
|
||||
|
||||
*> check in root dir
|
||||
move 1 to skip
|
||||
move file-name(skip:) to test-name
|
||||
perform check-file
|
||||
|
||||
move dir-name(skip:) to test-name
|
||||
perform check-file
|
||||
|
||||
goback.
|
||||
|
||||
check-file.
|
||||
call "CBL_CHECK_FILE_EXIST" using test-name file-info
|
||||
if return-code equal zero then
|
||||
display test-name(1:32) ": size " file-size ", "
|
||||
file-year "-" file-month "-" file-day space
|
||||
file-hours ":" file-minutes ":" file-seconds "."
|
||||
file-hundredths
|
||||
else
|
||||
display "error: CBL_CHECK_FILE_EXIST " return-code space
|
||||
trim(test-name)
|
||||
end-if
|
||||
.
|
||||
|
||||
end program check-file-exist.
|
||||
|
|
@ -7,7 +7,7 @@ extension op
|
|||
= self.Available.iif("exists","not found");
|
||||
}
|
||||
|
||||
public program()
|
||||
public Program()
|
||||
{
|
||||
Console.printLine("input.txt file ",File.assign("input.txt").validatePath());
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
(file-exists-p "input.txt")
|
||||
(file-directory-p "docs")
|
||||
(file-exists-p "/input.txt")
|
||||
(file-directory-p "/docs")
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
include file.e
|
||||
|
||||
procedure ensure_exists(sequence name)
|
||||
object x
|
||||
sequence s
|
||||
x = dir(name)
|
||||
if sequence(x) then
|
||||
if find('d',x[1][D_ATTRIBUTES]) then
|
||||
s = "directory"
|
||||
else
|
||||
s = "file"
|
||||
end if
|
||||
printf(1,"%s %s exists.\n",{name,s})
|
||||
else
|
||||
printf(1,"%s does not exist.\n",{name})
|
||||
end if
|
||||
end procedure
|
||||
|
||||
ensure_exists("input.txt")
|
||||
ensure_exists("docs")
|
||||
ensure_exists("/input.txt")
|
||||
ensure_exists("/docs")
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
if (Test-Path -Path .\input.txt) {
|
||||
write-host "File input exist"
|
||||
}
|
||||
else {
|
||||
write-host "File input doesn't exist"
|
||||
}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
exists? %input.txt
|
||||
exists? %docs/
|
||||
|
||||
exists? %/input.txt
|
||||
exists? %/docs/
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
Set FSO = CreateObject("Scripting.FileSystemObject")
|
||||
|
||||
Function FileExists(strFile)
|
||||
If FSO.FileExists(strFile) Then
|
||||
FileExists = True
|
||||
Else
|
||||
FileExists = False
|
||||
End If
|
||||
End Function
|
||||
|
||||
Function FolderExists(strFolder)
|
||||
If FSO.FolderExists(strFolder) Then
|
||||
FolderExists = True
|
||||
Else
|
||||
Folderexists = False
|
||||
End If
|
||||
End Function
|
||||
|
||||
'''''Usage (apostrophes indicate comments-this section will not be run)'''''
|
||||
'If FileExists("C:\test.txt") Then
|
||||
' MsgBox "It Exists!"
|
||||
'Else
|
||||
' Msgbox "awww"
|
||||
'End If
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
'Shorter version
|
||||
|
||||
If CreateObject("Scripting.FileSystemObject").FileExists("d:\test.txt") Then
|
||||
Wscript.Echo "File Exists"
|
||||
Else
|
||||
Wscript.Echo "File Does Not Exist")
|
||||
End If
|
||||
Loading…
Add table
Add a link
Reference in a new issue