Windows: Implement getwd() & make ls() public.
							parent
							
								
									bed7440ebb
								
							
						
					
					
						commit
						e9c00c3d39
					
				
							
								
								
									
										18
									
								
								os/os_win.v
								
								
								
								
							
							
						
						
									
										18
									
								
								os/os_win.v
								
								
								
								
							| 
						 | 
					@ -4,11 +4,22 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module os
 | 
					module os
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fn ls(path string) []string {
 | 
					pub fn ls(path string) []string {
 | 
				
			||||||
	mut res := []string
 | 
						mut res := []string
 | 
				
			||||||
	return res
 | 
						return res
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pub fn getwd() string {
 | 
				
			||||||
 | 
						mut buffer := malloc(512)
 | 
				
			||||||
 | 
						
 | 
				
			||||||
 | 
						buffer = C._getcwd(0, 0)
 | 
				
			||||||
 | 
						// A NULL return value indicates an error
 | 
				
			||||||
 | 
						if isnil(buffer) {
 | 
				
			||||||
 | 
							return ''
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return string(buffer)
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const (
 | 
					const (
 | 
				
			||||||
	FILE_ATTRIBUTE_DIRECTORY = 16
 | 
						FILE_ATTRIBUTE_DIRECTORY = 16
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
| 
						 | 
					@ -22,11 +33,6 @@ fn chdir(path string) {
 | 
				
			||||||
	C._chdir(path.cstr())
 | 
						C._chdir(path.cstr())
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fn getwd() string {
 | 
					 | 
				
			||||||
	panic('getwd() not impl')
 | 
					 | 
				
			||||||
	return ''
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
fn log(s string) {
 | 
					fn log(s string) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue