Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: src/d8.h

Issue 56107: * Add rmdir, mkdir -p and umask to d8 on Unix.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/d8.cc » ('j') | src/d8-posix.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // timeout2, if present, should be a number indicating the limit in 142 // timeout2, if present, should be a number indicating the limit in
143 // milliseconds on the total running time of the program. Exceptions are 143 // milliseconds on the total running time of the program. Exceptions are
144 // thrown on timeouts or other errors or if the exit status of the program 144 // thrown on timeouts or other errors or if the exit status of the program
145 // indicates an error. 145 // indicates an error.
146 // 146 //
147 // os.chdir(dir) changes directory to the given directory. Throws an 147 // os.chdir(dir) changes directory to the given directory. Throws an
148 // exception/ on error. 148 // exception/ on error.
149 // 149 //
150 // os.setenv(variable, value) sets an environment variable. Repeated calls to 150 // os.setenv(variable, value) sets an environment variable. Repeated calls to
151 // this method leak memory due to the API of setenv in the standard C library. 151 // this method leak memory due to the API of setenv in the standard C library.
152 //
153 // os.umask(alue) calls the umask system call and returns the old umask.
154 //
155 // os.mkdirp(name, mask) creates a directory. The mask (if present) is anded
156 // with the current umask. Intermediate directories are created if necessary.
157 // An exception is not thrown if the directory already exists. Analogous to
158 // the "mkdir -p" command.
152 static Handle<Value> OSObject(const Arguments& args); 159 static Handle<Value> OSObject(const Arguments& args);
153 static Handle<Value> System(const Arguments& args); 160 static Handle<Value> System(const Arguments& args);
154 static Handle<Value> ChangeDirectory(const Arguments& args); 161 static Handle<Value> ChangeDirectory(const Arguments& args);
155 static Handle<Value> SetEnvironment(const Arguments& args); 162 static Handle<Value> SetEnvironment(const Arguments& args);
163 static Handle<Value> SetUMask(const Arguments& args);
164 static Handle<Value> MakeDirectory(const Arguments& args);
165 static Handle<Value> RemoveDirectory(const Arguments& args);
166
167 static void AddOSMethods(Handle<ObjectTemplate> os_template);
156 168
157 static Handle<Context> utility_context() { return utility_context_; } 169 static Handle<Context> utility_context() { return utility_context_; }
158 170
159 static const char* kHistoryFileName; 171 static const char* kHistoryFileName;
160 static const char* kPrompt; 172 static const char* kPrompt;
161 private: 173 private:
162 static Persistent<Context> utility_context_; 174 static Persistent<Context> utility_context_;
163 static Persistent<Context> evaluation_context_; 175 static Persistent<Context> evaluation_context_;
164 static CounterMap* counter_map_; 176 static CounterMap* counter_map_;
165 // We statically allocate a set of local counters to be used if we 177 // We statically allocate a set of local counters to be used if we
(...skipping 22 matching lines...) Expand all
188 const char* name_; 200 const char* name_;
189 LineEditor* next_; 201 LineEditor* next_;
190 static LineEditor* first_; 202 static LineEditor* first_;
191 }; 203 };
192 204
193 205
194 } // namespace v8 206 } // namespace v8
195 207
196 208
197 #endif // V8_D8_H_ 209 #endif // V8_D8_H_
OLDNEW
« no previous file with comments | « no previous file | src/d8.cc » ('j') | src/d8-posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698