[Lazarus] File copy

Koenraad Lelong lazarus1 at de-brouwerij.be
Thu Apr 26 16:11:18 CEST 2012


On 26-04-12 15:45, Antonio Fortuny wrote:
>
>
> Le 26/04/2012 14:57, Koenraad Lelong a écrit :
>> Hi,
>>
>> I would like to make an application to centrally store documents. I
>> will put a reference to the location in a Firebird database, so I can
>> retrieve (and show) the document.
> This could lead to very big directories and I don't know any OS who
> loves this. This situation generalyy leads to a drastic preformance loose.

I will categorize the files, so they come in several directories.

>> I will let the user specify the source document, then the application
>> will copy the document to the central location. So, I wonder if there
>> is an OS-independent way to copy files.
> In fact input and output files depend on how your program access them. I
> guess that Win and Linux are mixed. In this case one solution is to use
> UNC and SMB sharing system on both sides: Windows folder share and Linux
> Samba server.

That's what will be used.

>> I could do block-read/block-writes, but is this the most efficient way
>> ? Or should I use an os-dependent call of the copy command ? Or
>> something else ?
> Using FPC, it is very easy to manage this with a pair of TFileStream
> provided each of them has an appropriate file path depending on the OS.

I'm looking into this. Thanks.

>> I could store the documents in the database, but I never worked with
>> blobs so I will try this in a next version.
> It is quite easy to use blobs (either binary or text) most of the times.
> What components set do you plan to use ?
> Lazarus SQLdb works very well in both 32 and 64 bit. Prodigy UIB
> components do the same work.

I am using SQLdb, but like I said that will be for the next version. And 
I'm considering a similar application retrieving files from CD-rom. I 
_think_ a CD-rom based database will be too slow. But I could be wrong.

Thank you very much, that was very helpfull.

Koenraad Lelong.




More information about the Lazarus mailing list