comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Files on external drive not accessible with hdf_open()
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Files on external drive not accessible with hdf_open() [message #93801] Thu, 20 October 2016 05:28 Go to next message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
Hi,
I'm encountering a strange problem opening a file on an external drive. I'm not sure if IDL or the system is generating the error.

So I use a command like this to open an hdf file:

f_id = hdf_open(inFileName, /read)

And I get a -1 as a result.
If I test for the file, I get 1 (=file existing and readable):

print, file_test(inFileName, /read)

This happens when my external drive turns off (goes idle) after a short brake or when I close and reopen my laptop (haven't checked which one...). Unplugging and replugging (unmounting, mounting) the drive solves the error. All other options I tried did not (reset IDL session, close-reopen IDL).

The command:
help, /files
does not give any information.

My question: how can I catch this error? I could of course test if hdf_open is -1 and file_test is 1 then tell the user "unmount and remount your drive", but maybe there is a better way to do this...

I would appreciate any help on the topic.

Cheers,
Helder
Re: Files on external drive not accessible with hdf_open() [message #93802 is a reply to message #93801] Thu, 20 October 2016 06:55 Go to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Thursday, October 20, 2016 at 2:28:29 PM UTC+2, Helder wrote:
> Hi,
> I'm encountering a strange problem opening a file on an external drive. I'm not sure if IDL or the system is generating the error.
>
> So I use a command like this to open an hdf file:
>
> f_id = hdf_open(inFileName, /read)
>
> And I get a -1 as a result.
> If I test for the file, I get 1 (=file existing and readable):
>
> print, file_test(inFileName, /read)
>
> This happens when my external drive turns off (goes idle) after a short brake or when I close and reopen my laptop (haven't checked which one...). Unplugging and replugging (unmounting, mounting) the drive solves the error. All other options I tried did not (reset IDL session, close-reopen IDL).
>
> The command:
> help, /files
> does not give any information.
>
> My question: how can I catch this error? I could of course test if hdf_open is -1 and file_test is 1 then tell the user "unmount and remount your drive", but maybe there is a better way to do this...
>
> I would appreciate any help on the topic.
>
> Cheers,
> Helder

Forgot to mention, that inFileName is an explicit file name (path+name) and is a scalar... in case anybody except me is wondering what the h... is going on.

Cheers,
Helder
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: getting uniform cadence data
Next Topic: multiplying two image arrays with different size

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 07:16:28 PDT 2025

Total time taken to generate the page: 0.00785 seconds