Mercurial > hg > xemacs-beta
comparison src/nt.c @ 380:8626e4521993 r21-2-5
Import from CVS: tag r21-2-5
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:07:10 +0200 |
parents | cc15677e0335 |
children | 74fd4e045ea6 |
comparison
equal
deleted
inserted
replaced
379:76b7d63099ad | 380:8626e4521993 |
---|---|
1167 sys_mktemp (temp); | 1167 sys_mktemp (temp); |
1168 if (rename (map_win32_filename (oldname, NULL), temp) < 0) | 1168 if (rename (map_win32_filename (oldname, NULL), temp) < 0) |
1169 return -1; | 1169 return -1; |
1170 } | 1170 } |
1171 | 1171 |
1172 /* Emulate Unix behaviour - newname is deleted if it already exists | 1172 /* Emulate Unix behavior - newname is deleted if it already exists |
1173 (at least if it is a file; don't do this for directories). | 1173 (at least if it is a file; don't do this for directories). |
1174 However, don't do this if we are just changing the case of the file | 1174 However, don't do this if we are just changing the case of the file |
1175 name - we will end up deleting the file we are trying to rename! */ | 1175 name - we will end up deleting the file we are trying to rename! */ |
1176 newname = map_win32_filename (newname, NULL); | 1176 newname = map_win32_filename (newname, NULL); |
1177 | 1177 |
1286 char fullname[ MAX_PATH ]; | 1286 char fullname[ MAX_PATH ]; |
1287 char * p; | 1287 char * p; |
1288 unsigned hash; | 1288 unsigned hash; |
1289 | 1289 |
1290 /* Get the truly canonical filename, if it exists. (Note: this | 1290 /* Get the truly canonical filename, if it exists. (Note: this |
1291 doesn't resolve aliasing due to subst commands, or recognise hard | 1291 doesn't resolve aliasing due to subst commands, or recognize hard |
1292 links. */ | 1292 links. */ |
1293 if (!win32_get_long_filename ((char *)name, fullname, MAX_PATH)) | 1293 if (!win32_get_long_filename ((char *)name, fullname, MAX_PATH)) |
1294 abort (); | 1294 abort (); |
1295 | 1295 |
1296 parse_root (fullname, &p); | 1296 parse_root (fullname, &p); |
1388 buf->st_nlink = 2; /* doesn't really matter */ | 1388 buf->st_nlink = 2; /* doesn't really matter */ |
1389 fake_inode = 0; /* this doesn't either I think */ | 1389 fake_inode = 0; /* this doesn't either I think */ |
1390 } | 1390 } |
1391 else if (!NILP (Vmswindows_get_true_file_attributes)) | 1391 else if (!NILP (Vmswindows_get_true_file_attributes)) |
1392 { | 1392 { |
1393 /* This is more accurate in terms of gettting the correct number | 1393 /* This is more accurate in terms of getting the correct number |
1394 of links, but is quite slow (it is noticable when Emacs is | 1394 of links, but is quite slow (it is noticeable when Emacs is |
1395 making a list of file name completions). */ | 1395 making a list of file name completions). */ |
1396 BY_HANDLE_FILE_INFORMATION info; | 1396 BY_HANDLE_FILE_INFORMATION info; |
1397 | 1397 |
1398 /* No access rights required to get info. */ | 1398 /* No access rights required to get info. */ |
1399 fh = CreateFile (name, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, | 1399 fh = CreateFile (name, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, |
1831 /* Timer precision, denominator of one fraction: for 100 ms | 1831 /* Timer precision, denominator of one fraction: for 100 ms |
1832 interval, request 10 ms precision | 1832 interval, request 10 ms precision |
1833 */ | 1833 */ |
1834 const int timer_prec = 10; | 1834 const int timer_prec = 10; |
1835 | 1835 |
1836 /* Last itimevals, as set by calls to setitimer */ | 1836 /* Last itimervals, as set by calls to setitimer */ |
1837 static struct itimerval it_alarm; | 1837 static struct itimerval it_alarm; |
1838 static struct itimerval it_prof; | 1838 static struct itimerval it_prof; |
1839 | 1839 |
1840 /* Timer IDs as returned by MM */ | 1840 /* Timer IDs as returned by MM */ |
1841 MMRESULT tid_alarm = 0; | 1841 MMRESULT tid_alarm = 0; |
1861 | 1861 |
1862 /* Zero means stop timer */ | 1862 /* Zero means stop timer */ |
1863 if (tv->tv_sec == 0 && tv->tv_usec == 0) | 1863 if (tv->tv_sec == 0 && tv->tv_usec == 0) |
1864 return 0; | 1864 return 0; |
1865 | 1865 |
1866 /* Conver to ms and divide by denom */ | 1866 /* Convert to ms and divide by denom */ |
1867 res = (tv->tv_sec * 1000 + (tv->tv_usec + 500) / 1000) / denom; | 1867 res = (tv->tv_sec * 1000 + (tv->tv_usec + 500) / 1000) / denom; |
1868 | 1868 |
1869 /* Converge to minimum timer resolution */ | 1869 /* Converge to minimum timer resolution */ |
1870 if (time_caps.wPeriodMin == 0) | 1870 if (time_caps.wPeriodMin == 0) |
1871 timeGetDevCaps (&time_caps, sizeof(time_caps)); | 1871 timeGetDevCaps (&time_caps, sizeof(time_caps)); |