[Qt-interest] How to tell a file is on the local network.
Mihail Naydenov
mlists at ymail.com
Sat Jan 1 16:25:28 CET 2011
Thank you both for the answers.
----- Original Message ----
> From: Arnold Krille <arnold at arnoldarts.de>
> To: qt-interest at trolltech.com
> Sent: Sat, January 1, 2011 4:51:22 PM
> Subject: Re: [Qt-interest] How to tell a file is on the local network.
>
> On Saturday 01 January 2011 14:00:18 Konrad Rosenbaum wrote:
> > It is rather simple to check a URL: get the host name from it - if it is
> > empty or "localhost" then the resource is local(*), otherwise it is on the
> > network.
>
> If the url starts with one of the names of the local machine, its also local.
> Well, it might be unless that directory is again mounted over network and only
>
> published by a local webserver.
>
> To the OP: Why does it matter where the file is? If you can access it for
> reading, you can read it. If you can access it for writing, you can write it.
> If you want to make your users happy, your app doesn't care whether its
> editing local files on disk or remote files via
> ftp(s)/sftp/webdav(s)/whatever...
Of course I agree.
Still I thought it will be nice to know when I am dealing with situations
unlikely to fail and when with such *highly* likely to fail.
I need fastest possible open, so I thought to use less caution approach for
files on the machine disk and be much more caution for files over the network
(even redirect them to QNetworkAccesManager completely for handling).
I will not argue if this is The Right Thing, I am just considering options.
Thanks
MihailNaydenov
>
> Have fun,
>
> Arnold
>
More information about the Qt-interest-old
mailing list