Last Comment Bug 766194 - [OS.File] Get file information
: [OS.File] Get file information
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Networking: File (show other bugs)
: unspecified
: All All
: -- enhancement (vote)
: mozilla17
Assigned To: David Teller [:Yoric] (please use "needinfo")
:
: Patrick McManus [:mcmanus]
Mentors:
Depends on:
Blocks: OS.File 769312 771094 775540
  Show dependency treegraph
 
Reported: 2012-06-19 10:45 PDT by David Teller [:Yoric] (please use "needinfo")
Modified: 2012-07-22 01:50 PDT (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Unix back-end (8.22 KB, patch)
2012-06-22 09:24 PDT, David Teller [:Yoric] (please use "needinfo")
no flags Details | Diff | Splinter Review
Windows back-end (2.82 KB, patch)
2012-06-22 09:25 PDT, David Teller [:Yoric] (please use "needinfo")
no flags Details | Diff | Splinter Review
Unix test suite (2.88 KB, patch)
2012-06-22 09:26 PDT, David Teller [:Yoric] (please use "needinfo")
no flags Details | Diff | Splinter Review
Unix constants (3.95 KB, patch)
2012-06-22 09:26 PDT, David Teller [:Yoric] (please use "needinfo")
no flags Details | Diff | Splinter Review
Windows front-end (2.95 KB, patch)
2012-07-03 08:48 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review-
Details | Diff | Splinter Review
Windows back-end (2.69 KB, patch)
2012-07-03 08:48 PDT, David Teller [:Yoric] (please use "needinfo")
no flags Details | Diff | Splinter Review
Windows test suite (4.04 KB, patch)
2012-07-03 08:49 PDT, David Teller [:Yoric] (please use "needinfo")
no flags Details | Diff | Splinter Review
Unix front-end (3.96 KB, patch)
2012-07-03 08:50 PDT, David Teller [:Yoric] (please use "needinfo")
no flags Details | Diff | Splinter Review
Unix back-end (7.56 KB, patch)
2012-07-03 08:50 PDT, David Teller [:Yoric] (please use "needinfo")
no flags Details | Diff | Splinter Review
Unix test suite (2.88 KB, patch)
2012-07-03 08:51 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review-
Details | Diff | Splinter Review
Unix constants (4.38 KB, patch)
2012-07-03 08:51 PDT, David Teller [:Yoric] (please use "needinfo")
no flags Details | Diff | Splinter Review
Companion testsuite (6.67 KB, patch)
2012-07-03 08:52 PDT, David Teller [:Yoric] (please use "needinfo")
no flags Details | Diff | Splinter Review
Shared code (2.05 KB, patch)
2012-07-03 23:27 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review+
Details | Diff | Splinter Review
Constants (4.43 KB, patch)
2012-07-03 23:28 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review+
Details | Diff | Splinter Review
Unix back-end (8.42 KB, patch)
2012-07-03 23:29 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review+
Details | Diff | Splinter Review
Unix front-end (3.73 KB, patch)
2012-07-03 23:31 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review-
Details | Diff | Splinter Review
Companion testsuite (6.66 KB, patch)
2012-07-03 23:32 PDT, David Teller [:Yoric] (please use "needinfo")
no flags Details | Diff | Splinter Review
Windows test suite (4.06 KB, patch)
2012-07-05 04:32 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review-
Details | Diff | Splinter Review
Windows back-end (3.73 KB, patch)
2012-07-05 04:32 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review+
Details | Diff | Splinter Review
Companion testsuite (4.91 KB, patch)
2012-07-05 04:36 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review-
Details | Diff | Splinter Review
Companion testsuite (4.85 KB, patch)
2012-07-12 08:37 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review+
Details | Diff | Splinter Review
(read this before the front-ends) Lazy getter argumentation (431 bytes, application/x-javascript)
2012-07-12 08:41 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: feedback+
Details
Unix front-end v2 (5.55 KB, patch)
2012-07-12 08:45 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review+
Details | Diff | Splinter Review
Windows front-end (7.06 KB, patch)
2012-07-13 06:52 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review+
Details | Diff | Splinter Review
Windows front-end v2 (7.97 KB, patch)
2012-07-17 07:01 PDT, David Teller [:Yoric] (please use "needinfo")
dteller: review+
Details | Diff | Splinter Review
Renaming link to symLink (5.12 KB, patch)
2012-07-17 07:10 PDT, David Teller [:Yoric] (please use "needinfo")
taras.mozilla: review+
Details | Diff | Splinter Review
Shared code (2.93 KB, patch)
2012-07-20 06:22 PDT, David Teller [:Yoric] (please use "needinfo")
dteller: review+
Details | Diff | Splinter Review
Unix constants (4.46 KB, patch)
2012-07-20 06:24 PDT, David Teller [:Yoric] (please use "needinfo")
dteller: review+
Details | Diff | Splinter Review
Unix back-end (8.88 KB, patch)
2012-07-20 06:24 PDT, David Teller [:Yoric] (please use "needinfo")
dteller: review+
Details | Diff | Splinter Review
Windows back-end (3.61 KB, patch)
2012-07-20 06:26 PDT, David Teller [:Yoric] (please use "needinfo")
dteller: review+
Details | Diff | Splinter Review
Windows constants (854 bytes, patch)
2012-07-20 06:27 PDT, David Teller [:Yoric] (please use "needinfo")
dteller: review+
Details | Diff | Splinter Review
Unix front-end (6.02 KB, patch)
2012-07-20 06:28 PDT, David Teller [:Yoric] (please use "needinfo")
dteller: review+
Details | Diff | Splinter Review
Windows front-end (10.05 KB, patch)
2012-07-20 06:29 PDT, David Teller [:Yoric] (please use "needinfo")
dteller: review+
Details | Diff | Splinter Review
Companion testsuite (7.40 KB, patch)
2012-07-20 06:29 PDT, David Teller [:Yoric] (please use "needinfo")
dteller: review+
Details | Diff | Splinter Review

Description David Teller [:Yoric] (please use "needinfo") 2012-06-19 10:45:03 PDT

    
Comment 1 David Teller [:Yoric] (please use "needinfo") 2012-06-22 09:24:03 PDT
Created attachment 635779 [details] [diff] [review]
Unix back-end
Comment 2 David Teller [:Yoric] (please use "needinfo") 2012-06-22 09:25:26 PDT
Created attachment 635780 [details] [diff] [review]
Windows back-end
Comment 3 David Teller [:Yoric] (please use "needinfo") 2012-06-22 09:26:34 PDT
Created attachment 635781 [details] [diff] [review]
Unix test suite
Comment 4 David Teller [:Yoric] (please use "needinfo") 2012-06-22 09:26:57 PDT
Created attachment 635783 [details] [diff] [review]
Unix constants
Comment 5 David Teller [:Yoric] (please use "needinfo") 2012-07-03 08:48:32 PDT
Created attachment 638745 [details] [diff] [review]
Windows front-end
Comment 6 David Teller [:Yoric] (please use "needinfo") 2012-07-03 08:48:58 PDT
Created attachment 638746 [details] [diff] [review]
Windows back-end
Comment 7 David Teller [:Yoric] (please use "needinfo") 2012-07-03 08:49:35 PDT
Created attachment 638747 [details] [diff] [review]
Windows test suite
Comment 8 David Teller [:Yoric] (please use "needinfo") 2012-07-03 08:50:12 PDT
Created attachment 638748 [details] [diff] [review]
Unix front-end
Comment 9 David Teller [:Yoric] (please use "needinfo") 2012-07-03 08:50:39 PDT
Created attachment 638749 [details] [diff] [review]
Unix back-end
Comment 10 David Teller [:Yoric] (please use "needinfo") 2012-07-03 08:51:09 PDT
Created attachment 638750 [details] [diff] [review]
Unix test suite
Comment 11 David Teller [:Yoric] (please use "needinfo") 2012-07-03 08:51:43 PDT
Created attachment 638751 [details] [diff] [review]
Unix constants
Comment 12 David Teller [:Yoric] (please use "needinfo") 2012-07-03 08:52:10 PDT
Created attachment 638752 [details] [diff] [review]
Companion testsuite
Comment 13 David Teller [:Yoric] (please use "needinfo") 2012-07-03 23:27:17 PDT
Created attachment 638975 [details] [diff] [review]
Shared code
Comment 14 David Teller [:Yoric] (please use "needinfo") 2012-07-03 23:28:23 PDT
Created attachment 638976 [details] [diff] [review]
Constants
Comment 15 David Teller [:Yoric] (please use "needinfo") 2012-07-03 23:29:18 PDT
Created attachment 638977 [details] [diff] [review]
Unix back-end
Comment 16 David Teller [:Yoric] (please use "needinfo") 2012-07-03 23:31:42 PDT
Created attachment 638980 [details] [diff] [review]
Unix front-end

Same one, minus debugging code.
Comment 17 David Teller [:Yoric] (please use "needinfo") 2012-07-03 23:32:18 PDT
Created attachment 638981 [details] [diff] [review]
Companion testsuite
Comment 18 David Teller [:Yoric] (please use "needinfo") 2012-07-05 04:32:05 PDT
Created attachment 639287 [details] [diff] [review]
Windows test suite
Comment 19 David Teller [:Yoric] (please use "needinfo") 2012-07-05 04:32:37 PDT
Created attachment 639288 [details] [diff] [review]
Windows back-end
Comment 20 David Teller [:Yoric] (please use "needinfo") 2012-07-05 04:36:38 PDT
Created attachment 639290 [details] [diff] [review]
Companion testsuite
Comment 21 (dormant account) 2012-07-10 14:22:34 PDT
David please include order of the patch in the queue in the name. Ie patch 1a: windows backend, patch 1b: unix backend.
Comment 22 (dormant account) 2012-07-10 14:23:20 PDT
Otherwise it's not immediately clear where 'Shared Code' fits, etc.
Comment 23 (dormant account) 2012-07-10 14:27:21 PDT
Comment on attachment 638975 [details] [diff] [review]
Shared code

r+ i guess. withName seems like abuse of the prototype stuff
Comment 24 (dormant account) 2012-07-10 14:28:36 PDT
Comment on attachment 638976 [details] [diff] [review]
Constants

ewww, but ok
Comment 25 (dormant account) 2012-07-10 14:29:39 PDT
(In reply to Taras Glek (:taras) from comment #23)
> Comment on attachment 638975 [details] [diff] [review]
> Shared code
> 
> r+ i guess. withName seems like abuse of the prototype stuff

Actually, given what you use it for, that's pretty awesome :)
Comment 26 (dormant account) 2012-07-10 14:32:12 PDT
Comment on attachment 638977 [details] [diff] [review]
Unix back-end

Eww, but this is as neat as possible in this case...i think.
Comment 27 (dormant account) 2012-07-10 14:44:50 PDT
Comment on attachment 638980 [details] [diff] [review]
Unix front-end

+         Object.defineProperty(this, "creationDate", {
+           value: date
+         });


why not this.creationDate = {value:date}?

i'm not sure i like .getInfo vs .stat. getInfo doesn't quite convey the severity of doing a stat.
Comment 28 (dormant account) 2012-07-10 14:50:09 PDT
Comment on attachment 638750 [details] [diff] [review]
Unix test suite

+  ok(change.getTime() - start.getTime() >= -10000, "test_stat: file has changed after the start of the test - " + change + ", " + start);
+  ok(change.getTime() - start.getTime() <= 10000, "test_stat: file has changed less than 10 seconds after the start of the test");
+  if (stat.st_btime) {
+    let birth = new Date(stat.st_btime * 1000);
+    ok(birth.getTime() - start.getTime() >= -10000, "test_stat: file was created after the start of the test - " + change);
+    ok(birth.getTime() - start.getTime() <= 10000, "test_stat: file was created less than 10 seconds after the start of the test");
+  }

This is bad. Magic 10second mark has got to go. Use change >= start.
Comment 29 (dormant account) 2012-07-10 14:50:36 PDT
Comment on attachment 638750 [details] [diff] [review]
Unix test suite

Sorry, meant to r-
Comment 30 (dormant account) 2012-07-10 15:02:16 PDT
(In reply to Taras Glek (:taras) from comment #28)
> Comment on attachment 638750 [details] [diff] [review]
> Unix test suite
> 
> +  ok(change.getTime() - start.getTime() >= -10000, "test_stat: file has
> changed after the start of the test - " + change + ", " + start);
> +  ok(change.getTime() - start.getTime() <= 10000, "test_stat: file has
> changed less than 10 seconds after the start of the test");
> +  if (stat.st_btime) {
> +    let birth = new Date(stat.st_btime * 1000);
> +    ok(birth.getTime() - start.getTime() >= -10000, "test_stat: file was
> created after the start of the test - " + change);
> +    ok(birth.getTime() - start.getTime() <= 10000, "test_stat: file was
> created less than 10 seconds after the start of the test");
> +  }
> 
> This is bad. Magic 10second mark has got to go. Use change >= start.

Note the best thing to do here is to do relative comparisons. Ie create two files in a row and check that fileA.creation <= fileB.creation. you can also do a strict comparison against well-known file like /bin/sh
You can then compare .modifcationTime against .creation
Comment 31 (dormant account) 2012-07-10 15:03:18 PDT
Comment on attachment 639287 [details] [diff] [review]
Windows test suite

r- for using magic 10seconds
Comment 32 (dormant account) 2012-07-10 15:04:43 PDT
Comment on attachment 639288 [details] [diff] [review]
Windows back-end

windows is so neat and tidy compared to unix :)
Comment 33 (dormant account) 2012-07-10 15:07:24 PDT
Comment on attachment 638745 [details] [diff] [review]
Windows front-end

Where is getInfo here? no call to GetFileInformationByHandle either
Comment 34 (dormant account) 2012-07-10 15:08:04 PDT
Comment on attachment 639290 [details] [diff] [review]
Companion testsuite

magic 10s again
Comment 35 David Teller [:Yoric] (please use "needinfo") 2012-07-11 09:32:15 PDT
> > r+ i guess. withName seems like abuse of the prototype stuff
> 
> Actually, given what you use it for, that's pretty awesome :)

Thanks :)
Comment 36 David Teller [:Yoric] (please use "needinfo") 2012-07-11 09:35:11 PDT
(In reply to Taras Glek (:taras) from comment #30)
> (In reply to Taras Glek (:taras) from comment #28)
> > Comment on attachment 638750 [details] [diff] [review]
> > Unix test suite
> > 
> > +  ok(change.getTime() - start.getTime() >= -10000, "test_stat: file has
> > changed after the start of the test - " + change + ", " + start);
> > +  ok(change.getTime() - start.getTime() <= 10000, "test_stat: file has
> > changed less than 10 seconds after the start of the test");
> > +  if (stat.st_btime) {
> > +    let birth = new Date(stat.st_btime * 1000);
> > +    ok(birth.getTime() - start.getTime() >= -10000, "test_stat: file was
> > created after the start of the test - " + change);
> > +    ok(birth.getTime() - start.getTime() <= 10000, "test_stat: file was
> > created less than 10 seconds after the start of the test");
> > +  }
> > 
> > This is bad. Magic 10second mark has got to go. Use change >= start.
> 
> Note the best thing to do here is to do relative comparisons. Ie create two
> files in a row and check that fileA.creation <= fileB.creation. you can also
> do a strict comparison against well-known file like /bin/sh
> You can then compare .modifcationTime against .creation

Note that |change >= start|does not work, as the file system and JS have different precisions. 

However, you are right, I should get rid of this. I have something simpler in mind, though.
Comment 37 David Teller [:Yoric] (please use "needinfo") 2012-07-11 09:44:56 PDT
(In reply to Taras Glek (:taras) from comment #27)
> Comment on attachment 638980 [details] [diff] [review]
> Unix front-end
> 
> +         Object.defineProperty(this, "creationDate", {
> +           value: date
> +         });
> 
> 
> why not this.creationDate = {value:date}?

I assume you mean
  |this.creationDate = date|

This works in all of cases in non-strict mode, but only in some cases in strict mode. After having been bitten a few times, I opted for the method that is harder to read but always works.

More precisely, in strict mode, this works if you have defined the getter during the definition of the object, but not if you have added the getter to an existing object, e.g. whenever any inheritance is involved.

> 
> i'm not sure i like .getInfo vs .stat. getInfo doesn't quite convey the
> severity of doing a stat.

I appreciate that. In JS, method names are always verbs, though, so perhaps |accessStat| or |accessInfo|?
Comment 38 (dormant account) 2012-07-11 16:44:29 PDT
(In reply to David Rajchenbach Teller [:Yoric] from comment #37)
> (In reply to Taras Glek (:taras) from comment #27)
> > Comment on attachment 638980 [details] [diff] [review]
> > Unix front-end
> > 
> > +         Object.defineProperty(this, "creationDate", {
> > +           value: date
> > +         });
> > 
> > 
> > why not this.creationDate = {value:date}?
> 
> I assume you mean
>   |this.creationDate = date|
> 
> This works in all of cases in non-strict mode, but only in some cases in
> strict mode. After having been bitten a few times, I opted for the method
> that is harder to read but always works.
> 
> More precisely, in strict mode, this works if you have defined the getter
> during the definition of the object, but not if you have added the getter to
> an existing object, e.g. whenever any inheritance is involved.

Where are you running into strict mode issues?

> 
> > 
> > i'm not sure i like .getInfo vs .stat. getInfo doesn't quite convey the
> > severity of doing a stat.
> 
> I appreciate that. In JS, method names are always verbs, though, so perhaps
> |accessStat| or |accessInfo|?

I suspect stat() is a verb in UNIX meaning retrieveStats.
Comment 39 (dormant account) 2012-07-11 16:53:13 PDT
Comment on attachment 638980 [details] [diff] [review]
Unix front-end

Waldo explained the defineProperty business.

Object.defineProperty(this, "creationDate", {value: date });has same effect as passing { value: date, enumerable: false, configurable: false, writable: false, etc } means the property is readonly, non-enumerable, non-configurable

Still not clear on what this has to do with strict mode. Until I get a better justification, r-
Comment 40 David Teller [:Yoric] (please use "needinfo") 2012-07-12 03:04:47 PDT
(In reply to Taras Glek (:taras) from comment #39)
> Comment on attachment 638980 [details] [diff] [review]
> Unix front-end
> 
> Waldo explained the defineProperty business.
> 
> Object.defineProperty(this, "creationDate", {value: date });has same effect
> as passing { value: date, enumerable: false, configurable: false, writable:
> false, etc } means the property is readonly, non-enumerable, non-configurable

Indeed.

> Still not clear on what this has to do with strict mode.

Actually, you may be right, this may be not related to strict mode.

> Until I get a
> better justification, r-

Not convinced it's a good idea, but as you wish.
Comment 41 David Teller [:Yoric] (please use "needinfo") 2012-07-12 03:05:13 PDT
(In reply to Taras Glek (:taras) from comment #38)
> > I appreciate that. In JS, method names are always verbs, though, so perhaps
> > |accessStat| or |accessInfo|?
> 
> I suspect stat() is a verb in UNIX meaning retrieveStats.

Ok.
Comment 42 David Teller [:Yoric] (please use "needinfo") 2012-07-12 08:37:47 PDT
Created attachment 641493 [details] [diff] [review]
Companion testsuite

I attach a new version of the test suite, without the 10s magic. Also, I think we can probably get around without the back-end test suite, since we have a front-end testsuite, so let's remove them for the moment.
Comment 43 David Teller [:Yoric] (please use "needinfo") 2012-07-12 08:41:28 PDT
Created attachment 641495 [details]
(read this before the front-ends) Lazy getter argumentation

I double-checked and I confirm that I need to call |defineProperty|, see attached demo. The presence/absence of "use strict" only switches between exception or silent error if I do not use |defineProperty|.
Comment 44 David Teller [:Yoric] (please use "needinfo") 2012-07-12 08:45:52 PDT
Created attachment 641496 [details] [diff] [review]
Unix front-end v2

Attaching a new version of the Unix front-end. This version changes the following:
- "stat" is now a verb :)
- more comments and documentation;
- option |noFollowLinks| is now |unixNoFollowLinks|;
- |get size| is now a lazy getter, uses |projectValue| and may return |NaN|.

I have tried rewriting lazy getters without |Object.defineProperty| and this just fails. See the previous attachment for more details.

I will attach a new version of the Windows front-end once we have agreed on the Unix back-end.
Comment 45 David Teller [:Yoric] (please use "needinfo") 2012-07-12 08:50:50 PDT
(In reply to Taras Glek (:taras) from comment #26)
> Comment on attachment 638977 [details] [diff] [review]
> Unix back-end
> 
> Eww, but this is as neat as possible in this case...i think.

Btw, I have experimented with alternatives:
- pointer arithmetics using the current brand of pointer arithmetics available in js-ctypes (much uglier);
- helper getters written in C (splits the code across four files and two languages instead of one, not more readable, most likely slower, plus requires unreviewed patches);
- pointer arithmetics based on bug 771928 (compatable readability, most likely slower, plus requires unreviewed patches).

I'd rather not pursue the alternatives in this bug, though. Perhaps in a following bug.
Comment 46 (dormant account) 2012-07-12 17:31:24 PDT
Comment on attachment 641493 [details] [diff] [review]
Companion testsuite

This is more reasonable. If it random oranges we'll have to do an approach that does not depend on non-filesystem time
Comment 47 (dormant account) 2012-07-12 17:31:55 PDT
Comment on attachment 641495 [details]
(read this before the front-ends) Lazy getter argumentation

sold. Thanks for the clear testcase
Comment 48 (dormant account) 2012-07-12 17:45:41 PDT
Comment on attachment 641496 [details] [diff] [review]
Unix front-end v2

Looks ok. 

I'm not clear on what projectValue is why a NaN would appear. But we can address that in an incremental patch, rest looks good.
Comment 49 David Teller [:Yoric] (please use "needinfo") 2012-07-13 06:51:14 PDT
(In reply to Taras Glek (:taras) from comment #48)
> Comment on attachment 641496 [details] [diff] [review]
> Unix front-end v2
> 
> Looks ok. 
> 
> I'm not clear on what projectValue is why a NaN would appear. But we can
> address that in an incremental patch, rest looks good.

If I understand correctly, there are two questions here:
- a |NaN| may appear on a OS with 64-bits |stat| if the size cannot be represented with 32 bits;
- |projectValue| is a utility I wrote to uniformize the transformation of js-ctypes integers into JS.
Comment 50 David Teller [:Yoric] (please use "needinfo") 2012-07-13 06:52:45 PDT
Created attachment 641853 [details] [diff] [review]
Windows front-end

Now let's move to the Windows front-end.
My apologies for the previous submission, I had marked the patch as "r?" by error.
Comment 51 (dormant account) 2012-07-16 16:08:04 PDT
(In reply to David Rajchenbach Teller (away until early August) [:Yoric] from comment #49)
> (In reply to Taras Glek (:taras) from comment #48)
> > Comment on attachment 641496 [details] [diff] [review]
> > Unix front-end v2
> > 
> > Looks ok. 
> > 
> > I'm not clear on what projectValue is why a NaN would appear. But we can
> > address that in an incremental patch, rest looks good.
> 
> If I understand correctly, there are two questions here:
> - a |NaN| may appear on a OS with 64-bits |stat| if the size cannot be
> represented with 32 bits;
> - |projectValue| is a utility I wrote to uniformize the transformation of
> js-ctypes integers into JS.

does that not go through a double conversion. So you'd only get a nan if you can't represent a 64bit int with a double?
Comment 52 (dormant account) 2012-07-16 16:21:33 PDT
Comment on attachment 641853 [details] [diff] [review]
Windows front-end

get isLink() { <-- missed that before

is link term ambigious. reparse-things are junctions, which are a type of symlink, so call this isSymLink. Same in the unix code(there is no way simple way to detect a hardlink).
Comment 53 David Teller [:Yoric] (please use "needinfo") 2012-07-17 07:01:24 PDT
Created attachment 642936 [details] [diff] [review]
Windows front-end v2
Comment 54 David Teller [:Yoric] (please use "needinfo") 2012-07-17 07:08:31 PDT
Comment on attachment 642936 [details] [diff] [review]
Windows front-end v2

Not sure what happened.
Comment 55 David Teller [:Yoric] (please use "needinfo") 2012-07-17 07:10:39 PDT
Created attachment 642938 [details] [diff] [review]
Renaming link to symLink

Here we go.
Comment 56 David Teller [:Yoric] (please use "needinfo") 2012-07-20 06:22:20 PDT
Created attachment 644288 [details] [diff] [review]
Shared code
Comment 57 David Teller [:Yoric] (please use "needinfo") 2012-07-20 06:24:00 PDT
Created attachment 644289 [details] [diff] [review]
Unix constants
Comment 58 David Teller [:Yoric] (please use "needinfo") 2012-07-20 06:24:42 PDT
Created attachment 644290 [details] [diff] [review]
Unix back-end
Comment 59 David Teller [:Yoric] (please use "needinfo") 2012-07-20 06:26:20 PDT
Created attachment 644291 [details] [diff] [review]
Windows back-end
Comment 60 David Teller [:Yoric] (please use "needinfo") 2012-07-20 06:27:43 PDT
Created attachment 644292 [details] [diff] [review]
Windows constants
Comment 61 David Teller [:Yoric] (please use "needinfo") 2012-07-20 06:28:08 PDT
Created attachment 644293 [details] [diff] [review]
Unix front-end
Comment 62 David Teller [:Yoric] (please use "needinfo") 2012-07-20 06:29:00 PDT
Created attachment 644294 [details] [diff] [review]
Windows front-end
Comment 63 David Teller [:Yoric] (please use "needinfo") 2012-07-20 06:29:30 PDT
Created attachment 644295 [details] [diff] [review]
Companion testsuite
Comment 64 David Teller [:Yoric] (please use "needinfo") 2012-07-20 06:35:31 PDT
Just had a little fun toying with Windows APIs.

For future reference:
- Windows presents the current hour in UTC, JS and Unix in local time;
- to determine if a file is a directory with |GetInformationByFileHandle|, you have to open the handle with so-called "backup semantics";
- under Windows, creating a file sets the file creation date _except_ if you have just removed a file with the same name and the file system hasn't flushed the buffer yet.

Running the last tests, and I hope we can checkin this tomorrow.
Comment 65 Tim Taubert [:ttaubert] 2012-07-21 10:39:37 PDT
Will push it.

Note You need to log in before you can comment on or make changes to this bug.