Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,23 +0,0 @@
|
|||
with Ada.Directories,
|
||||
Ada.Direct_IO,
|
||||
Ada.Text_IO;
|
||||
|
||||
procedure Whole_File is
|
||||
|
||||
File_Name : String := "whole_file.adb";
|
||||
File_Size : Natural := Natural (Ada.Directories.Size (File_Name));
|
||||
|
||||
subtype File_String is String (1 .. File_Size);
|
||||
package File_String_IO is new Ada.Direct_IO (File_String);
|
||||
|
||||
File : File_String_IO.File_Type;
|
||||
Contents : File_String;
|
||||
|
||||
begin
|
||||
File_String_IO.Open (File, Mode => File_String_IO.In_File,
|
||||
Name => File_Name);
|
||||
File_String_IO.Read (File, Item => Contents);
|
||||
File_String_IO.Close (File);
|
||||
|
||||
Ada.Text_IO.Put (Contents);
|
||||
end Whole_File;
|
||||
|
|
@ -1,35 +0,0 @@
|
|||
with Ada.Text_IO,
|
||||
POSIX.IO,
|
||||
POSIX.Memory_Mapping,
|
||||
System.Storage_Elements;
|
||||
|
||||
procedure Read_Entire_File is
|
||||
|
||||
use POSIX, POSIX.IO, POSIX.Memory_Mapping;
|
||||
use System.Storage_Elements;
|
||||
|
||||
Text_File : File_Descriptor;
|
||||
Text_Size : System.Storage_Elements.Storage_Offset;
|
||||
Text_Address : System.Address;
|
||||
|
||||
begin
|
||||
Text_File := Open (Name => "read_entire_file.adb",
|
||||
Mode => Read_Only);
|
||||
Text_Size := Storage_Offset (File_Size (Text_File));
|
||||
Text_Address := Map_Memory (Length => Text_Size,
|
||||
Protection => Allow_Read,
|
||||
Mapping => Map_Shared,
|
||||
File => Text_File,
|
||||
Offset => 0);
|
||||
|
||||
declare
|
||||
Text : String (1 .. Natural (Text_Size));
|
||||
for Text'Address use Text_Address;
|
||||
begin
|
||||
Ada.Text_IO.Put (Text);
|
||||
end;
|
||||
|
||||
Unmap_Memory (First => Text_Address,
|
||||
Length => Text_Size);
|
||||
Close (File => Text_File);
|
||||
end Read_Entire_File;
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
$fileOpen = FileOpen("file.txt")
|
||||
$fileRead = FileRead($fileOpen)
|
||||
FileClose($fileOpen)
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
(setq my-variable (with-temp-buffer
|
||||
(insert-file-contents "foo.txt")
|
||||
(buffer-string)))
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
function load_file(sequence filename)
|
||||
integer fn,c
|
||||
sequence data
|
||||
fn = open(filename,"r") -- "r" for text files, "rb" for binary files
|
||||
if (fn = -1) then return {} end if -- failed to open the file
|
||||
|
||||
data = {} -- init to empty sequence
|
||||
c = getc(fn) -- prime the char buffer
|
||||
while (c != -1) do -- while not EOF
|
||||
data &= c -- append each character
|
||||
c = getc(fn) -- next char
|
||||
end while
|
||||
|
||||
close(fn)
|
||||
return data
|
||||
end function
|
||||
|
|
@ -1 +0,0 @@
|
|||
Get-Content foo.txt
|
||||
|
|
@ -1 +0,0 @@
|
|||
Get-Content foo.txt -Encoding UTF8
|
||||
|
|
@ -1 +0,0 @@
|
|||
(Get-Content foo.txt) -join "`n"
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
read %my-file ; read as text
|
||||
read/binary %my-file ; preserve contents exactly
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
dim s
|
||||
s = createobject("scripting.filesystemobject").opentextfile("slurp.vbs",1).readall
|
||||
wscript.echo s
|
||||
|
|
@ -1 +0,0 @@
|
|||
wscript.echo createobject("scripting.filesystemobject").opentextfile("utf16encoded.txt",1,-1).readall
|
||||
Loading…
Add table
Add a link
Reference in a new issue