[Lazarus] strange linux problem

2014-02-19 Thread brian

Hi all,

I'm trying to write a small utility program to clean up a LOT of files 
on a network drive. This is using Debian 7.2, and a recent svn version 
of Lazarus (I actually use fpcup to do the downloads and builds). The 
information on the 'About' page is version 1.3, date 2014-02-12, fpc 
version 2.6.3, svn revision 44027, x86_64-linux-gtk 2


This may well be a lack of experience with Linux programming on my 
part, but it has me baffled. The program I've written needs to do a 
bunch of chmods and/or deletes on the files on the network drive. 
Stepping through with the debugger, some, but not all, of the 
attempted chmods return a status of -1. Some, but not all, of the 
calls to sysutils.deletefile return false. What is puzzling me is that 
if, instead of calling fpchmod and sysutils.deletefile I instead call 
fpsystem and do the operations that way, it works. I can also run up a 
command prompt and do the failed operations that way with no problem.


The files on the network drive are all owned by me, the chmod is 
trying to set permissions to 644 rather than 777. The delete is just 
deleting a whole bunch of log files which got mixed up in there when 
the data was copied to the drive.


I have no idea why the above should happen, it makes no sense to me, 
but as I said, I'm still a relative novice as regards coding for 
Linux. Everything is being run from the same account. Can anybody 
point me in the right direction?



Thanks,

Brian.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] strange linux problem

2014-02-19 Thread Mattias Gaertner
On Wed, 19 Feb 2014 03:46:51 -0500
brian br...@meadows.pair.com wrote:

[...]
 on a network drive. This is using Debian 7.2, and a recent svn version 
 of Lazarus (I actually use fpcup to do the downloads and builds). The 
 information on the 'About' page is version 1.3, date 2014-02-12, fpc 
 version 2.6.3, svn revision 44027, x86_64-linux-gtk 2
[...]
 chmods and/or deletes on the files on the network drive. 
 Stepping through with the debugger, some, but not all, of the 
 attempted chmods return a status of -1. Some, but not all, of the 
 calls to sysutils.deletefile return false. What is puzzling me is that 
 if, instead of calling fpchmod and sysutils.deletefile I instead call 
 fpsystem and do the operations that way, it works. I can also run up a 
 command prompt and do the failed operations that way with no problem.
[...]

Is it reproducable on the same file?
Can you give an example file name?
What kind of network share?

Special characters, wrong encoding, server lock, faulty network.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Attn Martin, LazarusDir and FPCSourceDirectory not saved to environmentoptions.xml

2014-02-19 Thread Mattias Gaertner
On Fri, 14 Feb 2014 23:21:51 -0800 (PST)
leledumbo leledumbo_c...@yahoo.co.id wrote:

  Anyway I now see, that there is an invalid identifier: 
  NiceChartD7. 
 I added check. Please test.
 
 Tested and working. So, what the code would do now if such an invalid
 identifier occurs?

It does not save it.
I have to find out, where the space is coming from.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Getting help for a type if its unit is not in uses

2014-02-19 Thread Michael Schnell

On 02/18/2014 10:40 PM, Graeme Geldenhuys wrote:

Simply run:

   docview file1+file2+file_n
or
   docview path_to_INF_docs
or
   docview ENV_variable_of_path_or_files


I was trying o use Docview integrated in in the Lazarus IDE. This is 
fact worked rather nicely with multiple files. I seem to remember that 
there were some issues (AFAIR, you intended to solve some of them :-) )


-Michael

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] strange linux problem

2014-02-19 Thread brian

On 02/19/2014 04:07 AM, Mattias Gaertner wrote:

On Wed, 19 Feb 2014 03:46:51 -0500
brian br...@meadows.pair.com wrote:


[...]
on a network drive. This is using Debian 7.2, and a recent svn version
of Lazarus (I actually use fpcup to do the downloads and builds). The
information on the 'About' page is version 1.3, date 2014-02-12, fpc
version 2.6.3, svn revision 44027, x86_64-linux-gtk 2
[...]
chmods and/or deletes on the files on the network drive.
Stepping through with the debugger, some, but not all, of the
attempted chmods return a status of -1. Some, but not all, of the
calls to sysutils.deletefile return false. What is puzzling me is that
if, instead of calling fpchmod and sysutils.deletefile I instead call
fpsystem and do the operations that way, it works. I can also run up a
command prompt and do the failed operations that way with no problem.
[...]


Is it reproducable on the same file?


On the basis of two examples of each, yes.


Can you give an example file name?


Two of the files which failed to delete are unknown.mp4 and video_ts.vob.

Two files where the attempt to chmod them failed are 
The_Buddhas_Instruction_to_his_son.mp4 and 
Yogis_Of_Tibet_Rare_Documentary.mp4


In all cases, the full paths are made up of 
['A'..'Z','a'..'z','0'..'9','_'] only


(well, also '/' and '.', obviously!)



What kind of network share?

It's a Western Digital 4TB My Cloud drive, with the shared /nfs 
directory on the drive mounted to a root-level directory on my PC.


Nobody else is using the drive - I've only two PCs on the LAN, and my 
wife's machine was switched off. The drive is hanging off one of the 
ports of my four-port Linksys router.



Special characters, wrong encoding, server lock, faulty network.



Definitely not the first. I've written out the full paths to a log 
file, and they are correct - editing the logs and putting an 'ls ' in 
front of the file names provides the expected results. The drive is 
powered down overnight, and I'm the only user, so I can't see how 
there could be a server lock unless there's something wrong with the 
drive. I've seen nothing else to indicate a faulty router.



I know this all sounds crazy. I wouldn't have believed it had I not 
been seeing it for myself. The only thing I could come up with (and 
the reason for my post here) was that single-stepping under the 
debugger somehow caused the problem.


I'm not asking anybody to do any amount of research on this - it's 
trivial for me to tweak the program so that it writes commands to a 
file rather than tries to run the chmods and deletes, and I can just 
run the resulting file from the CLI.



Brian.


--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] strange linux problem

2014-02-19 Thread Mattias Gaertner
On Wed, 19 Feb 2014 08:42:40 -0500
brian br...@meadows.pair.com wrote:

 On 02/19/2014 04:07 AM, Mattias Gaertner wrote:
[...]  On Wed, 19 Feb 2014 03:46:51 -0500

  Special characters, wrong encoding, server lock, faulty network.
 
 
 Definitely not the first. I've written out the full paths to a log 
 file, and they are correct - editing the logs and putting an 'ls ' in 
 front of the file names provides the expected results. The drive is 
 powered down overnight, and I'm the only user, so I can't see how 
 there could be a server lock unless there's something wrong with the 
 drive. I've seen nothing else to indicate a faulty router.
 
 
 I know this all sounds crazy. I wouldn't have believed it had I not 
 been seeing it for myself. The only thing I could come up with (and 
 the reason for my post here) was that single-stepping under the 
 debugger somehow caused the problem.

Does that mean, it only appears when single stepping in the debugger?

Have you checked fpgeterrno?

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] strange linux problem

2014-02-19 Thread Mark Morgan Lloyd

brian wrote:

On 02/19/2014 04:07 AM, Mattias Gaertner wrote:

On Wed, 19 Feb 2014 03:46:51 -0500
brian br...@meadows.pair.com wrote:


[...]
on a network drive. This is using Debian 7.2, and a recent svn version
of Lazarus (I actually use fpcup to do the downloads and builds). The
information on the 'About' page is version 1.3, date 2014-02-12, fpc
version 2.6.3, svn revision 44027, x86_64-linux-gtk 2
[...]
chmods and/or deletes on the files on the network drive.
Stepping through with the debugger, some, but not all, of the
attempted chmods return a status of -1. Some, but not all, of the
calls to sysutils.deletefile return false. What is puzzling me is that
if, instead of calling fpchmod and sysutils.deletefile I instead call
fpsystem and do the operations that way, it works. I can also run up a
command prompt and do the failed operations that way with no problem.
[...]


Is it reproducable on the same file?


On the basis of two examples of each, yes.


Can you give an example file name?


Two of the files which failed to delete are unknown.mp4 and video_ts.vob.

Two files where the attempt to chmod them failed are 
The_Buddhas_Instruction_to_his_son.mp4 and 
Yogis_Of_Tibet_Rare_Documentary.mp4


In all cases, the full paths are made up of 
['A'..'Z','a'..'z','0'..'9','_'] only


(well, also '/' and '.', obviously!)


Check permissions/ownership of those files, and ownership/permissions of 
the directory containing them. Oh, and make sure that they're not 
actually symlinks to something unexpected, and that nothing's got them 
open (lsof command).


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] strange linux problem

2014-02-19 Thread Bart
SAMBA share?
IIRC there is some problem/bug with SMB that can cause problems with fpc.

Bart

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Getting help for a type if its unit is not in uses

2014-02-19 Thread Marco van de Voort
On Tue, Feb 18, 2014 at 09:40:38PM +, Graeme Geldenhuys wrote:
  But I never was able to generate the files for DocView from the current 
  revisions of the SVNs.
 
 Last time I tried (a couple months back) the LCL docs wasn't in a state
 that could be built - or it was a fpdoc bug not yet resolve. I'll update
 to the latest and see if things are better now. They should be.

I routinely build lcl.chm a couple a times an year, but usually have to run
the script to generate some XML files because the LCL build scripts use
wildcards to generate the fpdoc cmdline.

IOW, new pas files without docs break the build out of the box.
 

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] strange linux problem

2014-02-19 Thread waldo kitty

On 2/19/2014 8:42 AM, brian wrote:
[...]

Definitely not the first. I've written out the full paths to a log file, and
they are correct - editing the logs and putting an 'ls ' in front of the file
names provides the expected results. The drive is powered down overnight, and
I'm the only user, so I can't see how there could be a server lock unless
there's something wrong with the drive. I've seen nothing else to indicate a
faulty router.


have you tried adding at least a 1/4th second up to maybe a 1 second sleep just 
to try to ensure that it isn't a bottleneck somewhere? it could be the samba 
stuff... my XP machine used to drop its samba shares on a FreeNAS (bsd) any time 
there was a huge amount of traffic (copying several hundred megs of randomly 
sized small files, copying one huge [up to 2G] file, and similar) between the XP 
box and the NAS... the only way to regain access to the NAS was to reboot the XP 
box... no other machines exhibited this problem... it was finally solved when 
the XP box ate itself for lunch one day :/


--
NOTE: No off-list assistance is given without prior approval.
  Please keep mailing list traffic on the list unless
  private contact is specifically requested and granted.

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] lazbuild access violation

2014-02-19 Thread Sandro Cumerlato
Hello,
sorry for the raw bug report, but current lazbuild.exe compiled from
svn trunk doesn't work, calling:

\freepascal\laz\1.3\lazbuild.exe --pcp=\freepascal\lazarus project1.lpi

it generates the following error:

---
SetPrimaryConfigPath NewValue=\freepascal\lazarus - x:\freepascal\lazarus
primary config path: x:\freepascal\lazarus\
An unhandled exception occurred at $004CDEBD :
EAccessViolation : Access violation
  $004CDEBD  TBASECOMPILEROPTIONS__MAKEOPTIONSSTRING,  line 2834 of
compileroptions.pp
  $004CD77B  TBASECOMPILEROPTIONS__MAKEOPTIONSSTRING,  line 2435 of
compileroptions.pp
  $00507630  TLAZPACKAGEGRAPH__GETPACKAGECOMPILERPARAMS,  line 699 of
x:/freepascal/laz/1.3/packager/packagesystem.pas
  $0050DE66  TLAZPACKAGEGRAPH__CHECKIFCURPKGOUTDIRNEEDSCOMPILE,  line
3059 of x:/freepascal/laz/1.3/packager/packagesystem.pas
  $0050D233  TLAZPACKAGEGRAPH__CHECKIFPACKAGENEEDSCOMPILATION,  line
2961 of x:/freepascal/laz/1.3/packager/packagesystem.pas
  $00518AAF  TLAZPACKAGEGRAPH__COMPILEPACKAGE,  line 3415 of
x:/freepascal/laz/1.3/packager/packagesystem.pas
  $0051872E  TLAZPACKAGEGRAPH__COMPILEREQUIREDPACKAGES,  line 3340 of
x:/freepascal/laz/1.3/packager/packagesystem.pas
  $00404965  STARTBUILDING,  line 796 of lazbuild.lpr
  $004046A7  TLAZBUILDAPPLICATION__BUILDPROJECT,  line 968 of lazbuild.lpr
  $00402869  TLAZBUILDAPPLICATION__BUILDFILE,  line 412 of lazbuild.lpr
  $0040809E  TLAZBUILDAPPLICATION__RUN,  line 1415 of lazbuild.lpr
  $0040A2B6  main,  line 1698 of lazbuild.lpr
---

I've tried to debug lazbuild.lpi and at line 2834 of compileroptions.pp

  CompilerFilename:=LazarusIDE.GetFPCompilerFilename;

I've found that LazarusIDE is nil.

Last change has been made yesterday by Mattias and I don't know if
this part is still under development and will be reworked soon:

http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/ide/compileroptions.pp?root=lazarusr1=44122r2=44141pathrev=44172

What do you think? Is it necessary to open a new bugtracker issue?

Thank you for reading!

Sandro

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] lazbuild access violation

2014-02-19 Thread Mattias Gaertner
On Wed, 19 Feb 2014 19:59:24 +0100
Sandro Cumerlato sandro.cumerl...@gmail.com wrote:

 Hello,
 sorry for the raw bug report, but current lazbuild.exe compiled from
 svn trunk doesn't work, calling:
 
 \freepascal\laz\1.3\lazbuild.exe --pcp=\freepascal\lazarus project1.lpi
 
 it generates the following error:
 
 ---
 SetPrimaryConfigPath NewValue=\freepascal\lazarus - x:\freepascal\lazarus
 primary config path: x:\freepascal\lazarus\
 An unhandled exception occurred at $004CDEBD :
 EAccessViolation : Access violation
   $004CDEBD  TBASECOMPILEROPTIONS__MAKEOPTIONSSTRING,  line 2834 of
 compileroptions.pp

Fixed.

Mattias

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] View Graphic File

2014-02-19 Thread Allan E. Registos
Hi all,

A noob question, I have trouble trying to port an existing vb.net
snippet to pascal. 
Can anyone provide a code snippet where we can download and view a file
from a Database?  A binary(jpeg/pdf file) was uploaded to a database
table. The code will just download the file uploaded and view it.

In vb.net this can be done:

  /  if conn.State = ConnectionState.Closed Then conn.Open()//
//sql = Select binfile from graphicfiles WHERE id=  id//
//
//cmd = New NpgsqlCommand(sql, conn)//
//
//Dim fileData As Byte() = DirectCast(cmd.ExecuteScalar(),
Byte())//
//
//Dim sTempFileName As String = Path.GetTempPath  \ 
sFileName//
//
//If Not fileData Is Nothing Then//
//
//'Read image data into a file stream //
//Using fs As New FileStream(sTempFileName,
FileMode.OpenOrCreate, FileAccess.Write)//
//fs.Write(fileData, 0, fileData.Length)//
//'Set image variable value using memory stream. //
//fs.Flush()//
//fs.Close()//
//End Using//
//
//Process.Start(sTempFileName) 'Open file//
//
//End If//
/
Thanks,,
Allan


smime.p7s
Description: S/MIME Cryptographic Signature
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus