harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yang Paulex" <paulex.y...@gmail.com>
Subject Re: [jira] Closed: (HARMONY-517) [classlib][luni] File.listFiles returns empty list but should return null
Date Thu, 31 May 2007 09:51:15 GMT
Alexei,

I got some problems on windows after this fix, seems the return value in
patch below should be reversed?

 I_32
 getPlatformIsReadable (JNIEnv * env, char *path)
 {
-  return 1;
+  HANDLE fHandle = CreateFile(path, GENERIC_READ, FILE_SHARE_READ,
+      NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+
+  if (fHandle == INVALID_HANDLE_VALUE) {
+    return 1; //Paulex: seems should return 0 here, which means not
readable.
+  }
+
+  CloseHandle(fHandle);
+  return 0; //Paulex: seems should return 1 here, which means readable.
 }

2007/5/30, Alexei Zakharov (JIRA) <jira@apache.org>:
>
>
>      [
> https://issues.apache.org/jira/browse/HARMONY-517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel]
>
> Alexei Zakharov closed HARMONY-517.
> -----------------------------------
>
>
> Fix was verified by Ruth. Issue closed.
>
> > [classlib][luni] File.listFiles returns empty list but should return
> null
> >
> -------------------------------------------------------------------------
> >
> >                 Key: HARMONY-517
> >                 URL: https://issues.apache.org/jira/browse/HARMONY-517
> >             Project: Harmony
> >          Issue Type: Bug
> >          Components: Classlib
> >            Reporter: Mark Hindess
> >            Assignee: Alexei Zakharov
> >            Priority: Minor
> >         Attachments: Harmony-517.diff, reading.chmod.0.directory.diff
> >
> >
> > On unix, if I create a directory and then change the permissions to make
> it unreadable ("chmod 0 dir") then File.listFiles() on that directory on
> RI returns null but on Harmony it returns the empty list.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>


-- 
Paulex Yang
China Software Development laboratory
IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message