Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-04

File copy

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Koenraad Lelong

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.
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.
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 ?
I could store the documents in the database, but I never worked with blobs so I will try this in a next version.

Comments, tips, etc. are welcome.

Thanks,

Koenraad Lelong.

Reply by email

Antonio Fortuny
to Koenraad Lelong

Le 26/04/2012 14:57, Koenraad Lelong a ?crit :

Show quoted text 5 lines
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 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.

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 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.

Show quoted text 14 lines
Comments, tips, etc. are welcome. Thanks, Koenraad Lelong. -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Koenraad Lelong
to Antonio Fortuny
Antonio Fortuny wrote 10 lines
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.

Show quoted text 7 lines
> 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.

Show quoted text 5 lines
> 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.

Show quoted text 6 lines
> 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.

Reply by email