From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,129433ab43bf5aef,start X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.224.190.193 with SMTP id dj1mr5055536qab.6.1358504036039; Fri, 18 Jan 2013 02:13:56 -0800 (PST) X-Received: by 10.49.116.1 with SMTP id js1mr1950308qeb.19.1358504035957; Fri, 18 Jan 2013 02:13:55 -0800 (PST) Path: k2ni675qap.0!nntp.google.com!p13no1201936qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 18 Jan 2013 02:13:55 -0800 (PST) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=130.240.232.139; posting-account=Rr9I-QoAAACS-nOzpA-mGxtAlZ46Nb6I NNTP-Posting-Host: 130.240.232.139 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <1d536a59-c2e6-40d8-bf1e-fa7a0b4a923a@googlegroups.com> Subject: cannot write to a file in Linux despite +rw permissions From: Ada novice Injection-Date: Fri, 18 Jan 2013 10:13:55 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2013-01-18T02:13:55-08:00 List-Id: Hello, I am a newbie in Linux and I have recently installed swiftlinux, whic= h is Debian based. I am testing my Ada codes. They run well (I have put GNA= T GPL 2011 for now), except that I see that I cannot write to text files. I= have issued the command "chmod -R +rw" to the parent folder but that doesn= 't help and neither did running GPS as root help.=20 If the compilation files are created and can be "destroyed" by the GPS clea= n command, this means that it should not be a problem to write to a text fi= le. I also have LaTeX installed and I have no difficulty to generate a pdf = file and modify it on subsequent compilation.=20 So I am a bit puzzled that I cannot write to a file as an output of an Ada = program. What happens is that the file gets created, say: "hi.text" but the= n it stays blank. I have tried to create the file "hi.txt" before running m= y Ada program in GPS but that is not helping also. Here's a small code that I'm using (this works fine on Windows with the fil= e and its contents created): with Ada.Float_Text_IO; with Ada.Text_IO; use Ada.Text_IO; procedure Test_Writing is X : Float :=3D 3.0; Y : Float :=3D 2.0; Output_Data_File_All : File_Type; procedure Write_Files_All (Output_File : File_Type; Out_1 : Float; Out_2 : Float; Prec : Natural :=3D 3 ) is begin Ada.Float_Text_IO.Put (File =3D> Output_File, Item =3D> Out_1,= Fore =3D> 3, Aft =3D> Prec, Exp =3D> 0); Ada.Text_IO.Put (Output_File, " "); Ada.Float_Text_IO.Put (File =3D> Output_File, Item =3D> Out_2,= Fore =3D> 3, Aft =3D> Prec, Exp =3D> 0); Ada.Text_IO.New_Line (Output_File); end Write_Files_All; begin Ada.Text_IO.Put ("Put file name to write for all elements: "); Create (Output_Data_File_All, Out_File, Get_Line); Ada.Text_IO.New_Line(1); for I in 1 .. 3 loop =20 Ada.Float_Text_IO.Put (Item =3D> X, Fore =3D> 3, Aft =3D> 4, = Exp =3D> 0); Ada.Float_Text_IO.Put (Item =3D> Y, Fore =3D> 3, Aft =3D> 5, = Exp =3D> 0); Ada.Text_IO.New_Line (1); --write to file Write_Files_All (Output_Data_File_All, Out_1 =3D> x, Out_2 =3D> y ); X :=3D X + 1.0; Y :=3D Y + 2.0; end loop; Close (Output_Data_File_All); end Test_Writing; Since the code compiles and runs fine in GPS, I do not understand why the f= ile cannot be written in the above case with the X and Y values. Guess it must be something on Linux that I am not paying attention to. Thanks for any suggestions. YC=20