@@ -300,12 +300,41 @@ impl Dir {
300300 } ) ?;
301301 Ok ( File ( unsafe { FileDesc :: from_raw_fd ( fd) } ) )
302302 }
303+ }
303304
304- // pub fn create_dir<P: AsRef<Path>>(&self, path: P) -> Result<()>
305- // pub fn rename<P: AsRef<Path>, Q: AsRef<Path>>(&self, from: P, to_dir: &Self, to: Q) -> Result<()>
306- // pub fn remove_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
307- // pub fn remove_dir<P: AsRef<Path>>(&self, path: P) -> Result<()>
308- // pub fn symlink<P: AsRef<Path>, Q: AsRef<Path>>(&self, original: P, link: Q)
305+ #[ cfg( any(
306+ miri,
307+ target_os = "redox" ,
308+ target_os = "nto" ,
309+ target_os = "vita" ,
310+ target_os = "hurd" ,
311+ target_os = "espidf" ,
312+ target_os = "horizon" ,
313+ target_os = "vxworks" ,
314+ target_os = "rtems" ,
315+ target_os = "nuttx" ,
316+ ) ) ]
317+ impl Dir {
318+ pub fn open < P : AsRef < Path > > ( & self , path : P ) -> io:: Result < File > {
319+ Err ( io:: const_error!(
320+ io:: ErrorKind :: Unsupported ,
321+ "directory handles are not available for this platform" ,
322+ ) )
323+ }
324+
325+ pub fn open_with < P : AsRef < Path > > ( & self , path : P , opts : & OpenOptions ) -> io:: Result < File > {
326+ Err ( io:: const_error!(
327+ io:: ErrorKind :: Unsupported ,
328+ "directory handles are not available for this platform" ,
329+ ) )
330+ }
331+
332+ pub fn open_c ( & self , path : & CStr , opts : & OpenOptions ) -> io:: Result < File > {
333+ Err ( io:: const_error!(
334+ io:: ErrorKind :: Unsupported ,
335+ "directory handles are not available for this platform" ,
336+ ) )
337+ }
309338}
310339
311340fn get_path_from_fd ( fd : c_int ) -> Option < PathBuf > {
0 commit comments